Skip to content

Don't retry the built-in Factory MCP spawn with a token that already failed - #16660

Draft
luigi-facilgroup wants to merge 1 commit into
warpdotdev:masterfrom
luigi-facilgroup:fix/factory-mcp-retry-same-token
Draft

luigi-facilgroup wants to merge 1 commit into
warpdotdev:masterfrom
luigi-facilgroup:fix/factory-mcp-retry-same-token

Conversation

@luigi-facilgroup

Copy link
Copy Markdown

Description

When the built-in Factory MCP server fails to start (e.g. the server returns 403 Forbidden), sync_builtin_servers respawned it on every subsequent auth event with the same bearer token, repeating the same failure indefinitely. The "same token, don't respawn" check only applied while the server was active.

This adds builtin_spawn_settled_for_token, which also treats a FailedToStart spawn for the current token as settled, so the built-in server is only retried once the token rotates. Behavior for an active/pending server is unchanged.

Linked Issue

Fixes #16659

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • Added builtin_spawn_with_failed_token_is_not_retried_until_token_rotates in templatable_manager_tests.rs (failed + same token is skipped, rotated token retries, NotRunning retries).

  • cargo test -p warp --lib ai::mcp: 92 passed.

  • cargo clippy -p warp --lib --tests -- -D warnings: clean.

  • I have manually tested my changes locally with ./script/run

Not manually tested: reproducing requires an account for which the Factory MCP endpoint returns 403.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Warp no longer repeatedly retries starting the built-in Factory MCP server with a credential that already failed.

🤖 Generated with Claude Code

…failed

When the built-in Factory MCP server fails to start (e.g. a 403 from the
server), every subsequent auth event (token refresh, user refresh) respawned
it with the same bearer token, repeating the same failure indefinitely. Treat
a failed spawn for the current token like a live one so we only retry once
the token rotates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cla-bot

cla-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @luigi-facilgroup on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Built-in Factory MCP server respawns on every auth event after a failed start, repeating the same 403

1 participant