Skip to content

fix(adapters): detect OpenCode from MCP client info - #1276

Open
rahul05ranjan wants to merge 1 commit into
mksglu:nextfrom
rahul05ranjan:fix/opencode-client-info-next
Open

rahul05ranjan wants to merge 1 commit into
mksglu:nextfrom
rahul05ranjan:fix/opencode-client-info-next

Conversation

@rahul05ranjan

Copy link
Copy Markdown

What / Why / How

Addresses the MCP clientInfo gap in #1255. OpenCode identifies itself as opencode, but that name was absent from the client map, so detection could fall through to another installed agent's directory. Mapping that name to the existing OpenCode adapter makes the explicit handshake win over ambient home-directory probes.

This does not change the fallback when a client provides no recognizable clientInfo; that broader detection policy remains open in #1255.

Affected platforms

  • OpenCode

Test plan

  • Added mapping and platform-detection tests, including another agent's environment marker.
  • pnpm exec vitest run tests/adapters/client-map.test.ts tests/adapters/detect.test.ts — 101 passed.
  • pnpm exec tsc --noEmit — passed.
  • git diff --check origin/next...HEAD — passed.

Checklist

  • Tests added/updated
  • npm test passes (full suite not run; focused tests above passed)
  • Typecheck passes via pnpm exec tsc --noEmit
  • Docs reviewed; no user-facing instructions change
  • No file path behavior changed
  • Targets next

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