Skip to content

Add opencode-go: provider and OpenCode session header - #81

Merged
linted merged 1 commit into
mainfrom
worktree-opencode-go
Nov 18, 2026
Merged

linted merged 1 commit into
mainfrom
worktree-opencode-go

Conversation

@linted

@linted linted commented Nov 18, 2026

Copy link
Copy Markdown
Owner

OpenCode Go is the same gateway under its own base URL (https://opencode.ai/inference/go) with the same Console key, so opencode-go:<model> reuses the opencode: builder with that base (OPENCODE_GO_API_URL overrides it).

Go requires a stable x-opencode-session header on every request, and pay-as-you-go uses it to keep a conversation on one backend and reuse its prompt cache, so both prefixes now send one. It is one ses_ id per process: models are built once at startup before any thread exists, so all agents in a run share it, which only affects routing. Both also send a ghidra-deep-agent/<version> User-Agent, which Go's terms ask clients to set.

Verified the headers reach the sync and async SDK clients of all three classes, and that the Go endpoint paths exist. No live completion run.

OpenCode Go is the same gateway under its own base URL
(https://opencode.ai/inference/go) with the same Console key, so
`opencode-go:<model>` reuses the opencode: builder with that base
(OPENCODE_GO_API_URL overrides it).

Go requires a stable `x-opencode-session` header on every request, and
pay-as-you-go uses it to keep a conversation on one backend and reuse its
prompt cache, so both prefixes now send one. It is one `ses_` id per
process: models are built once at startup before any thread exists, so
all agents in a run share it, which only affects routing. Both also send
a `ghidra-deep-agent/<version>` User-Agent, which Go's terms ask clients
to set.

Verified the headers reach the sync and async SDK clients of all three
classes, and that the Go endpoint paths exist. No live completion run.
@linted
linted merged commit 9d47334 into main Nov 18, 2026
2 checks passed
@linted
linted deleted the worktree-opencode-go branch November 18, 2026 01:37
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