feat: add OpenCode adapter as a native Codex Desktop harness - #19
Open
twodogegg wants to merge 1 commit into
Open
feat: add OpenCode adapter as a native Codex Desktop harness#19twodogegg wants to merge 1 commit into
twodogegg wants to merge 1 commit into
Conversation
Wire OpenCode through the ACP CLI adapter path, modeled after the Grok integration, with the same HarnessAdapter contract: - New @codexhost/adapter-opencode package with an ACP transport, model catalog built from configOptions, SQLite history recovery, and usage accounting - Encode OpenCode model ids (which may contain '/') into transport-safe opaque refs and decode them back when selecting models - Register the adapter in host-runtime adapter composition with CODEXHOST_OPENCODE_COMMAND override, classify transport-model routes in protocol-core, surface OpenCode in the production controller's enabled agents, and render it in the agent picker, sidebar icons, and binding probe - Add a searchable model submenu so large model catalogs (e.g. OpenCode) stay navigable - Update README support matrix and affected host-runtime/controller tests
|
To use Codex here, create an environment for this repo. |
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.
改动说明
将 OpenCode 以一等 Harness 接入 Codex Desktop,复用 Grok 的 ACP CLI adapter 架构,实现
HarnessAdapter契约。新增:
@codexhost/adapter-opencodeacp-transport.ts:通过opencode acp以 stdio JSON-RPC 通信;inspect()用session/new拿configOptions构建模型目录opencode-models.ts:OpenCode 模型 id 可含/,编解码为 transport-safe 的不透明 ref(/→~2f)opencode-history.ts/opencode-storage.ts:从~/.local/share/opencode/opencode.db恢复会话历史(session表用metadata列)opencode-usage.ts:usage 记账opencode-adapter.ts:实现HarnessAdapter(模型目录、thinking 选项、会话/turn 执行、历史恢复、usage)接线
case "opencode"路由分类CODEXHOST_OPENCODE_COMMAND覆盖默认命令路径)、approval 服务名enabledAgents加入opencode文档 / 测试
本地实测
inspect()返回 121 个模型 + thinking 选项(Low/High/Max)