Repository navigation
Opencode v2 support with auto-detection + configurable binary - #126
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #125.
Two commits:
1. feat: support opencode v2 alongside v1 with auto-detection
opencode --versionand uses matchingserveflags (v2 needs lowercase--log-level debug, which previously crashed startup), log patterns, health paths and/api/*routes; proxy maps SSE/mobile-eventto/api/eventon v2./api/infothen/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.2. feat(cli): support custom opencode binary via opencodeBin config
opencodeBinfield in~/.crosscode/config.json(e.g.opencode-v2);CROSSCODE_OPENCODE_BINenv var overrides it; defaults toopencode.Verified:
tscclean 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).