z'x on Discord: Test on an OpenCode Zen provider with the key public always
failed. Reproduced with Zen's real list: Test asked public for
claude-fable-5 on Messages and gemini-3-flash on Gemini, which public
doesn't reach (Zen's free models alone answer it), and big-pickle on
Responses, a chat-only model. Only chat (big-pickle) could pass, so the
card was red every time.
- testModel: on OpenCode's gateway a model models.dev names no API for
(no per-model provider.npm) is served on chat alone, so no other
endpoint is tried with it (a Claude id on Messages still is). This also
stops a paid key's Responses probe asking big-pickle.
- With public, only a free model (OpenCodeFree) is tried, and with none on
an API that API is left out of the result; with none on any, one row
says why (zenPublicNone), and a client-scoped Test says the same.
#2385 itself (deepseek-v4.1-flash-free not offered): the built-in Zen
lists whatever Zen's /models lists, with no table of free ones;
TestZenPublicListsNewFreeModels pins that with the real bytes. The model
was missing in the opencode-zen-free plugin, fixed there (zen-free 0.1.9,
magpie-community/plugins).
Fixtures: testdata/zen_public_models.json is Zen's /inference/v1/models
as the public key read it on 2026-10-15 (one GET, byte for byte);
zen_catalog.json is models.dev's opencode entries for those ids from the
same day's synced catalog.
Run (worktree at origin/main a1f7b8c13, -tags nogui -p 1):
- go test -run 'TestZen|TestOpenCode' ./internal/provider: ok
- the 77 provider tests that call Test, testModel or tiny, plus
TestZen*/TestOpenCode*: ok
- broken by hand: test.go back to main's, the two new tests kept:
TestZenPublicTestAsksFreeModels red (responses asked big-pickle,
anthropic claude-fable-5, gemini gemini-3-flash, all 401; own key's
Responses model big-pickle); green again with the fix
- gofmt -l clean; go vet -tags nogui ./internal/provider for darwin,
linux and windows: ok
Not tried: Test against real Zen. The fake answers 401 to a paid model
with public and to a model off its API, as the reporter's red rows say,
but Zen's exact status there wasn't asked. Responses now asks
muse-spark-1.2-contributor-free (first in Zen's list, "deprecated" in
models.dev though Zen lists it); whether Zen still answers it wasn't
asked.
Full suite: SUITE_LINE
c9cu: "opencode muse 1.3 又不行了,magpie v0.1.1239". Zen's free tier moved and
tightened in mid-October 2026, found against the real upstream on 10-15:
- free models answer only at https://opencode.ai/inference/v1 (models.dev's
opencode api is that URL now); OpenCodeFreeURL maps /zen/... there for a
free model, never /zen/go or another host, in forwardOnce and the probe;
- the bash and read tools offered must each have at least one parameter:
the stand-ins (zenfree.go, the probe) now carry OpenCode's own
(OpenCodeToolSchemas);
- a request carrying x-session-affinity is answered 403 FreeTierError.
OpenCode 1.19.0, captured through a forwarding proxy, sends Zen neither
x-session-affinity nor X-Session-Id, so OpenCodeClient takes both out;
the agent's own session id still names x-opencode-session.
Bisected header by header: X-Session-Id, Accept and the UA version
don't matter; x-session-affinity alone turns a 200 into a 403.
Live against the real Zen with the public key (a test file since removed):
muse via /v1/responses streamed (xhigh) and not, big-pickle on chat
streamed, mimo-v2.6-flash-free on chat: all 200; muse via /v1/messages 200.
The same code with x-session-affinity left in: 403 on every case.
Run: gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows
-tags nogui on internal/provider and internal/gateway; the full
go test -tags nogui -count=1 ./... in a sandbox HOME, whose one red was
gateway's TestOpenCodeClientHeaders still expecting the two headers
(updated here), then internal/gateway alone again: ok (678s).
New tests TestZenFreeAtInferenceURL, TestOpenCodeFreeURL and the probe's
non-empty properties check fail on the old code.
The community plugin got the same fix in magpie-community/plugins 5fc0a75
(zen-free 0.1.7); its npm publish is blocked on the repo's publisher setup.
An OpenCode Zen provider added with no key asks with public, the key
OpenCode sends signed out (normalize). On a Zen provider that already had
a key of the user's own, Add another key said only "paste an API key", and
with nothing pasted AddKey refused before it knew which provider it was
("paste the key to add"), so there was no way to learn of public or add it
as the anonymous fallback behind the user's own key.
- provider: Provider.AnonymousKey is the key a provider is asked with when
the user has none (OpenCode Zen's public, by its preset, as normalize
already decided; "" for every other, Kilo included). AddKey looks the
provider up first; nothing pasted adds that key, and asked again says
"<name> already has public, the key its free models answer with none of
yours" rather than "already has this key". Every other provider still
wants a key pasted. normalize reads the same method.
- gui: /api/providers names anonKey on a provider that has such a key and
doesn't have it yet. Its Add another key field reads "paste an API key,
or leave empty for public: free models only" (title too, where a narrow
field cuts it short), and the row added is marked as any new key's is.
zh, zh-TW, ja and de translations.
Verified:
- TestZenAddKeyEmptyIsPublic (provider) fails on the old code with
"paste the key to add"; TestZenAddAnotherKeyEmptyAddsPublic (gui,
through /api/keys/add and /api/providers) fails with `Zen with its own
key offers ""`. Both pass with the change.
- zen-anon-key.test.cjs: 40 pass in chromium and webkit, en/zh/zh-TW/ja/de,
at 900 and 560px; on the old app.js the placeholder test fails
('paste an API key' vs the new hint).
- gui-de, gui-ja, gui-zh-tw, i18n-keys, key-import, provider-many-keys,
nokey-editor, key-copy: 46 pass.
- Not tried against Zen itself: whether a gateway falling from a spent key
to public on a paid model rests public is unchanged behavior, the same as
for public typed by hand.