Repository navigation
Conversation
Co-authored-by: Daigrin <198701947+Daigrin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize MCP parse middleware to enhance performance
fix(http): preserve typed owner/repo extraction on latest main
Oct 3, 2026
Daigrin
marked this pull request as ready for review
October 3, 2026 05:19
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation preserves lazy decoding and comprehensively tests the restored extraction behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Restores lightweight owner/repository extraction while preserving lazy MCP argument decoding.
Changes:
- Adds exported
OwnerandRepocontext fields. - Independently decodes owner and repository values.
- Adds regression coverage for malformed and nested arguments.
| File | Description |
|---|---|
pkg/context/mcp_info.go |
Adds owner and repository metadata fields. |
pkg/http/middleware/mcp_parse.go |
Extracts owner/repository without materializing all arguments. |
pkg/http/middleware/mcp_parse_test.go |
Covers extraction, edge cases, and body preservation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
7 of 13 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
Restore typed
Owner/Repoextraction while preserving main’s lazy argument decoding. Avoid allocating a full argument map during MCP request parsing.Why
The conflict resolution for PR #9 dropped owner/repo extraction. Restore it without reverting main’s
RawArguments/DecodeArgumentspath.What changed
OwnerandRepofields; keep the unusedArgumentsmap absent.json.RawMessagefields, preserving the valid field when the other has an invalid type.MCP impact
Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint— Formatting completed; linter installation was blocked by DNS resolution../script/test— Full race-enabled suite passed.Docs