feat: opencode client profile (#89) — release 0.38.0 - #90
Merged
Conversation
…+ providerHosts (#89) - src/clients/opencode.ts: zen gateway + device oauth + models.dev pins, x-opencode-session continuity, baseURL auto-enroll from opencode.json(c) - ClientWire.providerHosts: single-purpose LLM API hosts enrolled for interception; shared hosts (github.com, googleapis.com) stay tunnels - pricing: models.dev opencode provider last in trust order (zen-only ids priced, resold ids keep originating rates) - live-verified against the zen gateway: both dialect mounts captured, cross-process continuation merged into one session file Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #89.
What
cctrace opencodetraces opencode.ai's multi-provider CLI. deva#541 (deva opencode --trace) wraps this.wireDialect(pair)is already per-pair and shape-first, and the OpenCode Zen gateway mounts BOTH dialects side by side (/zen/v1/messages+/zen/v1/responses|chat/completions). One live run produced both; both reconstruct.ClientWire.providerHosts(new optional field): single-purpose LLM API hosts a multi-provider client can route to, enrolled unconditionally bybuildInterceptSet— decrypting a model-API host can only capture model traffic. Shared hosts (github.com, which mints the copilot token; googleapis.com) deliberately stay opaque tunnels; the existing api.github.com-never-intercepted regression guards this.x-opencode-session: ses_…— cross-run preload + exit auto-merge work unchanged (live-verified: a two-process continued session merged into onesession-ses_…jsonl, 4 turns, thinking blocks).opencodeConfigHostsscans"baseURL"in every opencode.json(c) the client reads ($OPENCODE_CONFIG, XDG global, cwd) — the codex config.toml precedent, one well-specified key, fail-soft.opencodeprovider (OpenCode Zen, wire-exact ids) appended LAST in trust order — zen-only models get cost chips, resold claude/gpt/grok ids keep originating rates.Test plan (issue #89)
cctrace opencode -- run …captures gateway traffic with CA installed (live, zen)/zen/v1/messagesmount intercepted + dialect-detected; BYO key not available in this container (unit-covered)🤖 Generated with Claude Code