Skip to content

fix(http): preserve typed owner/repo extraction on latest main - #29

Open
Daigrin with Copilot wants to merge 2 commits into
mainfrom
copilot/perfmcp-parse-arguments
Open

Daigrin with Copilot wants to merge 2 commits into
mainfrom
copilot/perfmcp-parse-arguments

Conversation

Copilot AI commented Oct 3, 2026 •

Copy link
Copy Markdown

Summary

Restore typed Owner/Repo extraction 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/DecodeArguments path.

What changed

  • Context: Restore exported Owner and Repo fields; keep the unused Arguments map absent.
  • Parsing: Decode owner/repo through a typed struct with independent json.RawMessage fields, preserving the valid field when the other has an invalid type.
  • Coverage: Add regressions for mixed types, duplicate fields, non-object arguments, nested data, and body restoration.

MCP impact

  • No tool or API changes — MCP tool schemas and responses are unchanged.
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

  • Not applicable; no tool changes.

Security / limits

  • No security or limits impact — Existing authorization, argument validation, and request-size handling remain unchanged.
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR — Tool names are unchanged.

Note: 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

  • Linted locally with ./script/lint — Formatting completed; linter installation was blocked by DNS resolution.
  • Tested locally with ./script/test — Full race-enabled suite passed.

Docs

  • Not needed — No tool schema or configuration changes.
  • Updated (README / docs / examples)

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
Copilot AI requested a review from Daigrin October 3, 2026 05:13
@Daigrin
Daigrin marked this pull request as ready for review October 3, 2026 05:19
Copilot AI balanced review requested due to automatic review settings October 3, 2026 05:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Owner and Repo context 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants