test(proto): cover MCP and agent wire encoding - #3446
Open
Qalipso wants to merge 1 commit into
Open
Conversation
internal/proto was at 12.0% statement coverage. This covers the serialization boundary: MCPState text/JSON encoding and its unknown value, the MCP and agent event types, and the custom MarshalJSON/ UnmarshalJSON pairs that carry a non-JSON error field across the wire as a string and rebuild it on the other side. Coverage goes from 12.0% to 34.3%. No non-test code is changed.
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the Contributor License Agreement (CLA) and hereby sign the CLA. |
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.
internal/protois at 12.0% statement coverage. It is the client/server wire format, and most of it is pure encoding logic that can be tested directly.This adds tests for:
MCPState:String, text round-trip for every state, theunknownfallback for an out-of-range value, that an unrecognised name is rejected, and that it encodes as its text form inside JSON rather than as its numeric valueMCPEventType,AgentEventType,MessageRoleandFinishReasontext round-tripsMCPEvent,MCPClientInfoandAgentEventJSON round-trips, including that theerrorfield (which is not a JSON type) crosses the wire as its message and is rebuilt on decode, and that it is omitted when nilAgentEvent's optional fields (run_id,session_id,session_title,progress,done) stay off the wire when unsetCoverage goes from 12.0% to 34.3%. No non-test code is changed;
go vetandgo test -racepass.