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.