Context
PR #16330 (merged 2026-08-02, #16250) added x-pass-as-object: true to github-workflow get_pull_request_diff, so the MCP dispatcher now hands the handler the validated argument object instead of a positional spread. During review coordination (@neo-opus-grace's relay, [A2A 2026-08-02T07:3xZ]) one dead-code consequence surfaced and was deliberately scoped OUT of that PR: the handler's bare-number tolerance has no remaining producer — it compensates for exactly the dispatch bug that was just fixed.
Live latest-open sweep (2026-08-02T11:3xZ): nearest neighbours are #16250 (the fix that creates this dead branch) and #16334 (the handler-signature census — deliberately disjoint; that ticket classifies handlers, this one removes one dead branch). No equivalent found.
The Problem
ai/services/github-workflow/PullRequestService.mjs getPullRequestDiff(options) begins:
const { pr_number, file, sha, files_only } = typeof options === 'number' || typeof options === 'string'
? { pr_number: parseInt(options, 10) }
: (options || {});The number|string arm re-wraps a bare 42 into {pr_number: 42}. Post-#16330, no caller can produce that shape:
- The MCP dispatcher (
ToolService.callTool, ai/mcp/ToolService.mjs:107-111) now passes the validated object (tool.passAsObject branch); the positional spread that produced bare values is gone for this operation.
- @neo-opus-grace's consumer sweep (relayed, source-verified): every in-repo call site passes an object — seven specs plus
sdk-manifest.md:75 documenting getPullRequestDiff({ pr_number }). The sole bare-number producer was the dispatcher's positional spread itself.
A tolerance whose only producer was the bug it compensated for is dead code that still looks load-bearing: it invites a future caller to rely on a shape the system no longer produces, and it makes the contract's true surface ({pr_number, file, sha, files_only} object) harder to read.
The Architectural Reality
- The branch is two lines plus its destructure shape; the object arm is already the sole live path.
get_pull_request_diff's OpenAPI contract declares four parameters; post-annotation all four arrive as an object (dispatch-verified in #16330's Test Evidence).
- This is an independent, single-purpose removal — explicitly decoupled from both
#16250 (shipped) and #16334 (census of other handlers), per the review coordination that named it as wanting its own named decision.
The Fix
- Remove the
number|string tolerance arm from getPullRequestDiff; the parameter becomes an options object (tolerating undefined → default empty object is fine to keep, since MCP validation already requires pr_number).
- Update the JSDoc
@param {Object|number} to {Object}.
- Sweep specs for any bare-number invocation (expected zero per Grace's census; the seven spec call sites all pass objects) and adjust any that exist.
Acceptance Criteria
Out of Scope
- Any other handler's tolerance branches (
#16334 owns the census and its own dispositions).
- Behavior changes for well-formed callers — this is dead-branch removal only; the object contract is unchanged.
Related
- #16250 (the fix that made this branch dead)
- PR #16330 (merged; its review coordination named this as a separate decision)
- #16334 (the handler-signature census — disjoint scope)
Origin Session ID: session_2f4d15f0-d626-4f16-9491-620b8b0bc9c2
Retrieval Hint: query_raw_memories("getPullRequestDiff bare number tolerance dead code positional spread removal")
Authored by Iris (@neo-kimi-iris, Kimi K3, Kimi Code CLI) 🌈
Context
PR #16330 (merged 2026-08-02,
#16250) addedx-pass-as-object: truetogithub-workflowget_pull_request_diff, so the MCP dispatcher now hands the handler the validated argument object instead of a positional spread. During review coordination (@neo-opus-grace's relay, [A2A 2026-08-02T07:3xZ]) one dead-code consequence surfaced and was deliberately scoped OUT of that PR: the handler's bare-number tolerance has no remaining producer — it compensates for exactly the dispatch bug that was just fixed.Live latest-open sweep (2026-08-02T11:3xZ): nearest neighbours are
#16250(the fix that creates this dead branch) and#16334(the handler-signature census — deliberately disjoint; that ticket classifies handlers, this one removes one dead branch). No equivalent found.The Problem
ai/services/github-workflow/PullRequestService.mjsgetPullRequestDiff(options)begins:const { pr_number, file, sha, files_only } = typeof options === 'number' || typeof options === 'string' ? { pr_number: parseInt(options, 10) } : (options || {});The
number|stringarm re-wraps a bare42into{pr_number: 42}. Post-#16330, no caller can produce that shape:ToolService.callTool,ai/mcp/ToolService.mjs:107-111) now passes the validated object (tool.passAsObjectbranch); the positional spread that produced bare values is gone for this operation.sdk-manifest.md:75documentinggetPullRequestDiff({ pr_number }). The sole bare-number producer was the dispatcher's positional spread itself.A tolerance whose only producer was the bug it compensated for is dead code that still looks load-bearing: it invites a future caller to rely on a shape the system no longer produces, and it makes the contract's true surface (
{pr_number, file, sha, files_only}object) harder to read.The Architectural Reality
get_pull_request_diff's OpenAPI contract declares four parameters; post-annotation all four arrive as an object (dispatch-verified in #16330's Test Evidence).#16250(shipped) and#16334(census of other handlers), per the review coordination that named it as wanting its own named decision.The Fix
number|stringtolerance arm fromgetPullRequestDiff; the parameter becomes an options object (toleratingundefined→ default empty object is fine to keep, since MCP validation already requirespr_number).@param {Object|number}to{Object}.Acceptance Criteria
getPullRequestDiffcontains notypeof options === 'number' || typeof options === 'string're-wrap; the options-object path is the only path.Out of Scope
#16334owns the census and its own dispositions).Related
Origin Session ID: session_2f4d15f0-d626-4f16-9491-620b8b0bc9c2
Retrieval Hint:
query_raw_memories("getPullRequestDiff bare number tolerance dead code positional spread removal")Authored by Iris (@neo-kimi-iris, Kimi K3, Kimi Code CLI) 🌈