Skip to content

feat(mcp): pass an optional generation through mark_pr_fix - #1081

Merged
joryirving merged 1 commit into
mainfrom
feat/mcp-mark-generation
Sep 27, 2026
Merged

joryirving merged 1 commit into
mainfrom
feat/mcp-mark-generation

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Refs #1074. mark_pr_fix calls /api/pr-fix-queue/mark with the agent bearer token, and #1079 rejects bearer marks without generation, so the MCP tool would 400 on every call once #1079 ships. This adds an optional generation input and passes it through. Nothing changes until a caller supplies it, so it's safe to merge ahead of #1079.

@joryirving
joryirving force-pushed the feat/mcp-mark-generation branch from f405906 to 2e836c5 Compare September 26, 2026 20:43

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Automated Review

Full PR review.

Analysis engine: MiniMax-M3@https://litellm.jory.dev/v1 (anthropic) — primary route

Recommendation

Approve. This is a minimal, backward-compatible extension to the MCP mark_pr_fix tool that adds an optional generation parameter and threads it through markPrFix to the /api/pr-fix-queue/mark endpoint. All CI checks (lint, typecheck, tests, build, Docker builds, migrations, coverage) are green, the change matches the linked intent, and no secrets, migrations, or auth-bearing paths are touched.

Change-by-change findings

src/lib/mc-client.ts (1 addition)

  • markPrFix input gains generation?: number. The field is forwarded as part of the existing JSON body via mcJson/POST. Because the field is optional and the existing mcJson helper spreads/serializes the input object, omitting generation preserves today's wire format exactly — the PR body is correct.

src/mcp/server.ts (7 additions)

  • markPrFixHandler now passes generation: args.generation as number | undefined into markPrFix.
  • The tool's Zod schema gains generation: z.number().int().positive().optional() with a description that explicitly references PR 1074/PR 1079. The type cast as number | undefined is safe because Zod has already validated the argument.
  • No other tools, transport wiring, or auth logic is touched.

src/lib/mc-client.test.ts (12 additions)

  • A new test asserts that when generation: 3 is passed, the POST body to /api/pr-fix-queue/mark includes { repo, pr, status, generation: 3 }. This is a direct test of the new pass-through behavior at the HTTP boundary.

Sources

  • PR body explains the motivation (Refs PR 1074) and forward-compat with PR 1079.
  • Diff is confined to src/lib/mc-client.ts, src/lib/mc-client.test.ts, src/mcp/server.ts.
  • CI: all checks green (lint, typecheck, tests, build, Docker builds, migrations, coverage, smoke, npm audit, database integration).

Standards Compliance

  • Tech stack (Next.js/TypeScript), no secrets introduced, no migrations, no auth changes, no label/PR contract changes. Optional Zod field with .optional() matches the codebase's standard incremental schema-extension pattern. No conflict with AGENTS.md.

Tool Harness Findings

  • The tool harness section is present but reports that the native tool-calling loop issued no tool calls and no evidence was gathered. Nothing to report.

Unknowns or Needs Verification

  • The corpus does not include the body of PR 1074 or PR 1079 (no linked issue context provided). I cannot verify against issue-level acceptance criteria beyond what the PR body states; however, the change is small, backward-compatible, and CI-clean, so this is low risk.

@joryirving
joryirving merged commit 8bfca74 into main Sep 27, 2026
12 checks passed
@joryirving
joryirving deleted the feat/mcp-mark-generation branch September 27, 2026 03:05
@its-miso its-miso Bot mentioned this pull request Sep 26, 2026
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.

1 participant