Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2612452b78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Arrange. | ||
| wire := []byte(`{"jsonrpc":"2.0","id":1,"method":` + tt.value + `}`) | ||
| // Act. | ||
| msg, err := DecodeMessage(wire) | ||
| // Assert. |
There was a problem hiding this comment.
Remove redundant test-phase comments
In each of these new tests, the Arrange, Act, and Assert labels only restate the immediately following code and add noise instead of explaining why the test is structured this way; remove these repeated labels so the tests remain self-documenting as required by the repository's comment guidance.
AGENTS.md reference: AGENTS.md:L45-L47
Useful? React with 👍 / 👎.
Decoding
"method":"tools/call"currently invokesinternaljson.Unmarshala second time after decoding the envelope. Its streaming decoder allocates a minimum 32 KiB buffer even for this short scalar. Decode the method value withencoding/json.Unmarshalinstead.The envelope still uses the existing case-sensitive, depth-limited decoder. Method presence classification (including empty and null values) is preserved. Added tests cover strings, escapes, Unicode, invalid types, field-name case sensitivity, and envelope depth rejection.
BenchmarkDecodeMethodRequestbefore/after on upstream baseb5d319b00902, Go 1.27.1, darwin/arm64 (three runs, 1000 iterations):tools/calltools\u002fcallThis saves approximately 32 KiB per request decode. Timing measurements were noisy and are not used to claim an end-to-end latency improvement. This does not change the shared JSON helper or ID parsing.
Validation:
go test ./... -timeout=10mgo test -race ./internal/jsonrpc2 ./mcp -timeout=10mgo vet ./...go build ./...External conformance and downstream application performance gates were not run.