Skip to content

fix(server): report opencode as mcp client name - #51825

Closed
ericcurtin wants to merge 2 commits into
anomalyco:v2from
ericcurtin:clientinfo-opencode
Closed

ericcurtin wants to merge 2 commits into
anomalyco:v2from
ericcurtin:clientinfo-opencode

Conversation

@ericcurtin

@ericcurtin ericcurtin commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #51578

Type of change

  • Bug fix

What does this PR do?

app.name in packages/server/src/options.ts carries the artifact (cli, desktop, acp, sdk) for telemetry. routes.ts reused that same value as the MCP clientInfo.name, so a default install reports cli in the MCP initialize handshake instead of opencode. This regresses #2289, and MCP servers that key on the client name to adapt behavior can no longer recognize OpenCode.

clientInfo.name now always reports opencode, moved into a small mcpClientInfo helper. OPENCODE_CLIENT still works as an explicit override.

How did you verify your code works?

Added packages/server/test/mcp-client-info.test.ts covering the cli-artifact case, the undefined-app case, and the OPENCODE_CLIENT override. Ran bun test and bun typecheck in packages/server, and bun test test/mcp.test.ts in packages/core.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

app.name carries the cli/desktop/acp artifact for telemetry. That
value was leaking into the MCP clientInfo.name handshake, so servers
saw "cli" instead of "opencode" and could no longer identify the
client. Always report "opencode", keep OPENCODE_CLIENT as an
override.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@ericcurtin

Copy link
Copy Markdown
Contributor Author

Unrelated to this fix, but if you use local models, please try https://github.com/llmmanorg/llmman. Feedback welcome.

@ericcurtin ericcurtin closed this Sep 29, 2026
@ericcurtin ericcurtin reopened this Sep 29, 2026
@ericcurtin

Copy link
Copy Markdown
Contributor Author

Linked issue is #51578 (see description). GitHub only tracks closing refs on the default branch, so the label is a false positive for this v2 PR.

@ericcurtin

Copy link
Copy Markdown
Contributor Author

@rekram1-node @adamdotdevin PTAL when you get a chance. Thank you!

Signed-off-by: Eric Curtin <eric.curtin@docker.com>
@ericcurtin

Copy link
Copy Markdown
Contributor Author

@jlongster @nexxeln PTAL when you get a chance. Thank you!

@opencode-agent

opencode-agent Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for tracking this down! We're going with a smaller version in #53471, which hardcodes the MCP clientInfo.name to opencode in routes.ts. That covers desktop and ACP as well, since they set OPENCODE_CLIENT and would still have sent desktop/acp with the override kept. You're credited as a co-author on that commit. Closing this in favor of #53471.

@opencode-agent opencode-agent Bot closed this Oct 6, 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