Skip to content

🔐 fix: Share One Authorization Card Across Concurrent Calls on the Same Link - #99

Open
busla wants to merge 1 commit into
aproorg/0.8.8from
fix/mcp-elicitation-retry
Open

busla wants to merge 1 commit into
aproorg/0.8.8from
fix/mcp-elicitation-retry

Conversation

@busla

@busla busla commented Oct 28, 2026

Copy link
Copy Markdown

Why

On apro-prod (ai.apro.is), an agent fanning out parallel invoke_tool calls on the apro gateway got one URL elicitation card per call. The gateway's interceptor now serves one authorization link per user and provider to all of them (genai-infra LibreChat-AI#469), and AgentCore Identity links are single-use: the first open answers 302 to the provider, every later open answers 400 Invalid request. So the second and third cards carried a dead link, and the duplicate cards also consumed the three-per-server pending cap (Too many pending authorizations on the slack call while github and tempo cards were open, 2026-10-27 22:28 UTC).

What

  • MCPManager.callTool: concurrent calls that receive the same (user, server, url) join the first call's mcp_elicit flow instead of raising their own card; each retries tools/call once consent completes. The join map is released with the flow.
  • A retry after "complete" that still answers -32042 now throws … Authorization did not complete. Open <url> to authorize, then retry. instead of the raw error with a dead link.

Tests

urlElicitation.integration.test.ts: two concurrent gated calls → one elicitationStart, one createFlow, both results authorized; a "complete" without consent → the incomplete-authorization error. All 46 elicitation tests and the 211 MCPManager tests pass.

🤖 Generated with Claude Code

…me Link

An aggregating MCP gateway (the apro AgentCore gateway with its interceptor)
serves one single-use authorization link per user and provider to every
concurrent tool call that needs consent. Each call raised its own URL
elicitation card with that same link, so after the first click the other
cards pointed at a dead session (AgentCore answers 400 "Invalid request" on a
second open), and the extra cards also ate the per-server pending-authorization
cap, which is how "Too many pending authorizations" surfaced for the slack
call on apro-prod while github and tempo cards were open.

Concurrent calls that receive the same link now join the first call's flow:
one card, one click authorizes them all, and each call retries once consent
completes. A retry that still needs consent (the user clicked "I've
authorized" without finishing) now reads as incomplete authorization with the
link to open, instead of the raw -32042.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 67763aa5-db84-45d3-ad82-2a4a939686d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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