Repository navigation
Conversation
OpenCode Go's gateway requires x-opencode-session on every request and serves each model over its own wire; the generic OpenAI-compatible provider sends neither. Register a first-class provider under opencode-go, select each model's transport from kwwk's catalog, and stamp the conversation's session id. The key-only sign-in, display name, mark and translations follow the existing provider table.
kwwk now registers OpenCode's two plans (the key bound to each resolution, every request naming its conversation in x-opencode-session), sends native compaction no empty metadata (issue #26) and asks Gemini 4 by thinking level. Model Providers gains OpenCode Go and OpenCode Zen, API keys with an optional default model and their models listed from the plan, and kwwk 0.1.108's Kimi For Coding Global. PR #25's own OpenCode adapter is not needed; its mark and wording are. Pinned to EYHN/kwwk#226's head until v0.1.109 is tagged. Co-authored-by: Burç <21700838+burcb330134@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you, Burç! Your design for OpenCode Go went into kwwk itself (EYHN/kwwk#226), so Apelin 0.3.3 offers OpenCode Go and OpenCode Zen in Model Providers without a provider of its own. Closing this in favour of that: https://github.com/owngoal-dev/Apelin/releases/tag/v0.3.3 |
Thanks for getting back to me so fast, I just tested it and opencode integration works flawlessly! Apelin is exactly what I needed for AI-assisted on-device tweak development. Really grateful you built it! |
Why
Refs #23. OpenCode Go cannot be reached through the existing OpenAI-Compatible API provider: every Go request needs an
x-opencode-sessionheader, and kwwk v0.1.100 neither sends it nor registersopencode-goas a provider.Probed against the live gateway on 2026-10-30:
POST https://opencode.ai/inference/go/v1/chat/completionswithoutx-opencode-session→400 MissingSessionID, before auth./go/openai/v1/responses,/go/anthropic/v1/messagesand/go/google/....x-opencode-session: test-session, routing passes and the request reaches auth/model errors.GET https://opencode.ai/inference/go/v1/models→200, 28 models with anapifamily per model.kwwk carries the
opencode-gocatalog and display name, but has noproviderDirectoryentry, noregisterStoredcase, and no occurrence ofx-opencode-session(checked the pinned revision andorigin/main). This PR adds the provider the same way DeepSeek was added.What
AgentProvider.openCodeGo(opencode-go), API-key sign-in only,oc_sk_…placeholder, in the API Keys group after DeepSeek.OpenCodeGoProviderregisters each model on the wire its catalog entry names:https://opencode.ai/inference/go/openai/v1https://opencode.ai/inference/go/anthropichttps://opencode.ai/inference/go/googleOpenCodeGoSessionProviderstampsx-opencode-sessionfrom the conversation's session id (a process id for verification and other requests with no conversation), followingCopilotRequestHeadersProvider; it forwards session cleanup and native compaction.https://opencode.ai/inference/go/v1/models; known catalog ids keep theircompat, reasoning levels, image input and context. Unknown ids fall back to Chat Completions, which Console translates, with a conservative text-only, non-reasoning model.AGENTS.mddecision text and README provider list.Testing
make check— passed locally.swift buildinPackages/ApelinAgent— passed.swift testinPackages/ApelinAgent— 528 tests passed, including the newOpenCodeGoProviderTests,ProviderModelsTests,AccountDeskTestsandProviderKeyVerificationTestsadditions.swift test --filter OpenCodeGoLiveTests— compiles and skips withoutAPELIN_LIVE_OAUTH_PATH; not run against a real key here..debwas built locally: this machine has Xcode 26.3 / iOS 26.2, while the repo builds with Xcode 27.1 / iOS 27.1. CI'sbuildjob producesapelin-<sha>for device testing.To run the live test, add an
opencode-goentry to a kwwk-format credential file and run:Not included
x-opencode-sessionand is already reachable through OpenAI-Compatible athttps://opencode.ai/inference/v1. A named.openCodeZencan follow separately.opencode-goitself.Follow-ups
opencode-goregistration and the session header..deb: sign in, enable one Chat model and one Anthropic model, run a tool-call round trip on each.