Skip to content

fix(mcp): retry initialization without codemode on HTTP 400 - #47507

Merged
opencode-agent[bot] merged 1 commit into
v2from
mcp-retry-400
Sep 5, 2026
Merged

opencode-agent[bot] merged 1 commit into
v2from
mcp-retry-400

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Remote MCP servers that reject the injected codemode query parameter with HTTP 400 never reach the original-URL fallback because it only accepts HTTP 404.

  • Retry initialization once with the original configured URL on HTTP 400 as well as 404.
  • Preserve existing query parameters and headers, and leave user-supplied codemode values untouched.
  • Keep other statuses and post-initialization failures outside this fallback.

Validation

  • Reproduced the missing HTTP 400 retry with failing tests before changing the implementation.
  • MCP, OAuth, MCP instructions, and Code Mode exclusion tests: 80 passed.
  • Core bun typecheck: passed.
  • Prettier and git diff --check: passed.

Fixes #47502.

Requested by: @rekram1-node (Aiden via Slack)

@opencode-agent
opencode-agent Bot merged commit 7a4ad68 into v2 Sep 5, 2026
10 checks passed
@opencode-agent
opencode-agent Bot deleted the mcp-retry-400 branch September 5, 2026 15:49
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant