Conversation
A malformed wire line that parses as a response is dropped without any log: it cannot be correlated to a request id, so a caller's pending request simply never resolves. Warn at the drop site (standalone line and batch entry) with the deserialization error and a bounded preview of the raw line, so lost replies — e.g. an agent whose plugins write escape sequences into the JSON-RPC stream — are diagnosable instead of silent hangs.
Author
|
Sorry for this one. I never had the time to review this and my agent filed it without my consent. I'll review it properly and send you a new one if this is truly required. |
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.
What
Two
tracing::warn!calls at the sites where a malformed wire line that parses as a response is silently discarded (frame_entriesin the incoming protocol actor): the standaloneTransportFrame::Malformedarm and the response-shapedTransportBatchEntry::Malformedarm. Each log carries the deserialization error and a bounded preview of the raw line (200 chars — the line can be arbitrarily large and can carry user content).Why
A malformed response can never be correlated to a request id, so dropping it is correct — but the drop is invisible. Whatever caller sent the matching request is left with a pending future that never resolves, and nothing in the logs says why.
Real-world case that cost us an afternoon:
pie(an A2A/ACP host) droveopencode acpas a subprocess. opencode's warp plugin wrote OSC-777 escape sequences to stdout without newline discipline, gluing itself onto the next JSON-RPC frame. The glued line is unparseable, the real response inside it is unrecoverable, and the session appeared as an eternal spinner. With this warning, the log points straight at the corrupting line:Testing
malformed_standalone_response_is_ignored,protocol_actor_ignores_response_shaped_malformed_public_frame_entries) are untouched.cargo test -p agent-client-protocol(107 tests) green; clippy and rustfmt clean.