Skip to content

CL-8990: fix MCP HTTP auth recovery ignoring abort on callBlocks - #1174

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-8990-mcp-http-auth-recovery-ignores-abort-on-callblocks
Sep 27, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-8990-mcp-http-auth-recovery-ignores-abort-on-callblocks

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Cancelling an MCP tool call during HTTP auth recovery left the block-path waiter parked: callBlocks built a decoy {...authContext, signal} spread (HTTPAuthContext has no signal field) and omitted the third signal arg to withHTTPAuthorizationRecovery, so cancel never reached awaitRecovery.

Fix mirrors call: pass authContext unchanged plus signal as the third arg; the spread is deleted. No shared-machinery changes (per-waiter abort was already isolated; completeVerifiedRecovery already defers to waiters===0).

Tests (red-then-green in src/mcp/client-auth-reauth-cap.test.ts):

  • block-path clone of the shared-recovery abort test: two concurrent 401s, abort waiter 1 rejects "caller stopped", waiter 2 resolves, single waitForCode/finishAuth/authURL
  • block-path clone of the background-notify test: aborted waiter rejects, background finishAuth still fires onAuthorized
  • plugin-level test (src/mcp/plugin.test.ts): parked block-path call aborted mid-recovery surfaces {isError: true} with the abort reason instead of hanging

Verification:

  • bun run typecheck: exit 0
  • bun test src/mcp/client-auth-reauth-cap.test.ts src/mcp/plugin.test.ts src/mcp/client-auth-policy.test.ts: 43 pass, 0 fail, exit 0
  • bun run lint: exit 0
  • bun run build: exit 0

Fixes CL-8990

@linear-code

linear-code Bot commented Sep 25, 2026

Copy link
Copy Markdown

CL-8990

@TheGreatAxios
TheGreatAxios force-pushed the cl-8990-mcp-http-auth-recovery-ignores-abort-on-callblocks branch from 94c3392 to 1f7fe6c Compare September 27, 2026 22:32
@TheGreatAxios
TheGreatAxios enabled auto-merge (squash) September 27, 2026 22:33
@TheGreatAxios
TheGreatAxios merged commit 25c5172 into main Sep 27, 2026
12 of 13 checks passed
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