fix: ensure Mcp-Param- headers are passed when required - #14
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
A moderate correctness issue and a test coverage gap remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates tool routing to retain definitions and generate Mcp-Param-* headers for downstream HTTP calls.
Changes:
- Cache routed tool definitions and propagate call context.
- Generate encoded parameter headers from tool schemas.
- Add stateless/stateful integration coverage and update route tests.
Review findings:
component/http/client.go:389— Moderate: large integer values can be lost and headers silently omitted.http_param_headers_test.go:24— Nit: the test does not assert generated downstream headers.
File summaries
| File | Description |
|---|---|
http_param_headers_test.go |
Adds parameter-header integration coverage. |
handler.go |
Propagates tool definitions during calls. |
component/http/client.go |
Generates downstream parameter headers. |
component/component.go |
Stores tool-call context. |
catalog/routes.go |
Retains tools in routes. |
catalog/compiler.go |
Populates tool route definitions. |
catalog/compiler_test.go |
Updates route assertions. |
catalog/catalog_test.go |
Updates route assertions. |
Review details
Suppressed comments (1)
component/http/client.go:391
json.Unmarshalintoanyproduces afloat64, and this guard drops every integer outside the ±(2^53-1) range. JSON Schema integer arguments can validly be larger (for example, a 64-bit ID); when such a property hasx-mcp-header, silently omitting the header breaks the downstream call. Decode numbers withUseNumberor preserve the raw decimal token instead of rejecting them.
if value != math.Trunc(value) || value < -(1<<53-1) || value > 1<<53-1 {
return "", false
}
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A tool can specify that certain headers are required when using the streamable http transport. In the stateless protocol, the tools/call won't have information about which headers are required. This change caches the tool (not just the name) so that the proper headers can be included on the tools/call request. Signed-off-by: Donnie Adams <donnie@obot.ai>
thedadams
force-pushed
the
push-loprkssnksut
branch
from
September 12, 2026 16:39
472e861 to
2a8bda0
Compare
njhale
approved these changes
Sep 12, 2026
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.
A tool can specify that certain headers are required when using the streamable http transport. In the stateless protocol, the tools/call won't have information about which headers are required. This change caches the tool (not just the name) so that the proper headers can be included on the tools/call request.
Issue: obot-platform/obot#7840