Skip to content

Opencode v2 support with auto-detection + configurable binary - #126

Merged
snhsish merged 2 commits into
feat/landing-redesignfrom
feat/opencode-v2-support
Sep 29, 2026
Merged

snhsish merged 2 commits into
feat/landing-redesignfrom
feat/opencode-v2-support

Conversation

@snhsish

@snhsish snhsish commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Fixes #125.

Two commits:

1. feat: support opencode v2 alongside v1 with auto-detection

  • CLI detects the server major via opencode --version and uses matching serve flags (v2 needs lowercase --log-level debug, which previously crashed startup), log patterns, health paths and /api/* routes; proxy maps SSE /mobile-event to /api/event on v2.
  • Mobile negotiates the version per connection (probes /api/info then /global/health), remaps sessions/messages/permissions/files endpoints, unwraps {data} envelopes, handles both SSE shapes, and mutes share/todo/question on v2 instead of removing them.
  • V1 behavior is unchanged (unknown servers default to v1).

2. feat(cli): support custom opencode binary via opencodeBin config

  • Global opencodeBin field in ~/.crosscode/config.json (e.g. opencode-v2); CROSSCODE_OPENCODE_BIN env var overrides it; defaults to opencode.

Verified: tsc clean on both packages, CLI builds, live end-to-end runs against real v1 (opencode) and v2 (opencode-v2) binaries pass (spawn, proxy, session list, SSE stream, prompt/permission/fs shapes).

Detect the server major via opencode --version and use matching serve
flags (lowercase log level), log patterns, health paths and /api/*
routes. Mobile negotiates the version per connection, remaps
sessions/messages/permissions/files endpoints, handles both SSE
envelopes, and mutes share/todo/question on v2.

Fixes #125
Add a global opencodeBin field (~/.crosscode/config.json) so machines
where v2 lives under a different command (e.g. opencode-v2) can point
crosscode at it. CROSSCODE_OPENCODE_BIN env var overrides the file.
Defaults to opencode; version detection and flags adapt automatically.
@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
crosscode-web Ready Ready Preview Sep 29, 2026 2:30pm UTC

@snhsish
snhsish merged commit fcc5dd7 into feat/landing-redesign Sep 29, 2026
2 checks passed
@snhsish snhsish linked an issue Sep 29, 2026 that may be closed by this pull request

This branch was successfully deployed

1 active deployment
Preview — f63ae06a Deployed Sep 29, 2026 by vercel[bot]
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.

Opencode v2 not supported

1 participant