◐ Shell
clean mode source ↗

fix: recover from oversized JSON-RPC frames by PsiACE · Pull Request #111 · agentclientprotocol/python-sdk

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Draft

PsiACE

wants to merge 2 commits into

Conversation

@PsiACE

Summary

Related issues

Close #62

Testing

Docs & screenshots

Checklist

  • Conventional Commit title (e.g. feat:, fix:).
  • Tests cover the change or are not required (explain above).
  • Docs/examples updated when behaviour is user-facing.
  • Schema regenerations (make gen-all) are called out if applicable.

frostming

consumed = 1
if consumed > 0:
try:
await self._wait_for_reader(self._reader.readexactly(consumed))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle TimeoutError?

frostming

except asyncio.IncompleteReadError as exc:
return exc.partial
except asyncio.LimitOverrunError as exc:
await self._discard_oversized_line(exc.consumed)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of dropping the line and emit a warning, how about we read maximum limit bytes and concatenate the result manually?

2 participants

@PsiACE @frostming