fix: handle large JSON-RPC lines#1
Open
carlosflorencio wants to merge 4 commits into
Open
Conversation
Pre-v0.13.5 agents (e.g. auggie 0.29.x) still emit the top-level "models" field on session/new and session/load responses. Upstream v0.13.5 removed that field; this restores read-only parsing so downstream consumers can fall back to it when the new SessionConfigOption(category="model") surface is absent. Write-side helpers (UnstableSetSessionModel etc.) are NOT restored — agents that only support legacy selection are expected to be read-only from this SDK's perspective for now.
Restores the pre-v0.13.5 UnstableSetSessionModelRequest / UnstableSetSessionModelResponse types and a ClientSideConnection.UnstableSetSessionModel helper, plus a LegacyAgentMethodSessionSetModel = "session/set_model" constant. Companion to the LegacyModels read-side shim already in this file: together they let consumers continue to talk to agents (e.g. auggie 0.29.x) that haven't migrated from the unstable session/set_model surface to the stable session/set_config_option(category="model") surface. The constant is named with a Legacy prefix so the upstream constants_gen.go can stay untouched (no regeneration noise on future schema bumps).
ff0ebc5 to
e37105a
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
Summary by cubic
Fixes JSON-RPC receive to handle very large single-line frames by switching to chunked reading and raising the per-line limit to 64 MiB, with a clear error when exceeded. Adds a configurable inbound notification queue and improves disconnect/legacy compatibility.
Bug Fixes
New Features
acp.WithMaxQueuedNotifications(n)to configure inbound notification queue capacity; supported byNewClientSideConnectionandNewAgentSideConnection. ExposesErrNotificationQueueOverflowwhen the queue overflows. README updated.ErrPeerDisconnected; request errors now wrap it soerrors.Is(err, ErrPeerDisconnected)works.modelson session responses and added legacy model-selection client helpers:LegacyAgentMethodSessionSetModel,UnstableSetSessionModelRequest/Response, andClientSideConnection.UnstableSetSessionModel.Written for commit e37105a. Summary will update on new commits.