# @namzu/zen

## 5.2.0

### Minor Changes

- a235649: On a DeepSeek thinking model (thinking is on unless you turn it off), a subagent that stalled was sent a forced tool choice and died with `deepseek (HTTP 400): Thinking mode does not support this tool_choice`; four explorers failed that way in one session. Now the step that must act goes in words instead and the run carries on. `DeepSeekProvider` gains `acceptsForcedToolChoiceFor(model, thinking, effort)` (false while thinking is on) and refuses `toolChoice: 'required'` or a named function before sending anything, with a `bad_request` `ProviderRequestError` whose `providerCode` is `forced_tool_choice_unsupported`; `auto` and `none` are sent as before. In `@namzu/sdk` the optional `LLMProvider.acceptsForcedToolChoiceFor` takes the effort the step will carry as a third argument, and the retry, idle-timeout and fallback wrappers forward it; existing implementations that take two arguments keep working. `@namzu/zen` answers it for the Go models whose route takes only `auto`, so those no longer fail the step either. Not covered: the OpenRouter, HTTP and OpenAI drivers do not answer it, so a DeepSeek thinking model reached through them is still sent a forced choice as given, and a `toolChoice` that a caller's own `prepareStep` forces reaches the driver unchanged (against DeepSeek with thinking on it now fails with the clear `forced_tool_choice_unsupported` error, not the vendor's 400); say `auto` and name the tool in the prompt, or turn thinking off for that step.

## 5.1.3

### Patch Changes

- 52b4b7e: The Zen and Zen Go catalogue refresh read its two documentation pages from a path that no longer exists upstream (`services/www`, now `services/site`), so every launch logged a 404 warning and kept the bundled catalogue; it reads the new path. A refresh that fails for a reason worth a warning now warns once every six hours and logs at `debug` in between; `NAMZU_HOME/cli/zen-catalogue-failed.json` holds the time of the last warning.

## 5.1.2

### Patch Changes

- 89abc04: A run could end with `HTTP 400: Invalid assistant message: content or tool_calls must be set` right after the model made a call that was denied or failed and then answered with nothing (no text, no call). The empty reply stayed in the history and went back to the provider in the next request. The loop no longer puts a reply with no text, call, reasoning or citation into a request. The DeepSeek, HTTP (both dialects), OpenRouter, Bedrock and Zen (chat lane) drivers also leave out an assistant entry that has neither text nor a tool call, and no longer send an empty `tool_calls` array. A call and its result are always kept together, the stored history and its reasoning are unchanged, and the HTTP anthropic dialect and Bedrock no longer send an empty reply as the text `"null"`. Nothing to do.

## 5.1.1

### Patch Changes

- 1ed55ae: A reply the service stopped with a content filter or safety block now sets `refusal: {}` on its finish chunk next to `finishReason: 'content_filter'` (OpenAI Chat Completions and Codex, DeepSeek, HTTP in both dialects, OpenRouter, Bedrock, Google including a blocked prompt, Zen). The finish reason is unchanged. `@namzu/sdk` reads the field to tell a declined request from an empty reply and no longer retries it as an empty completion; nothing else changes for these drivers.

## 5.1.0

### Minor Changes

- d8059dc: A response stream that closes without the provider's own end-of-response marker (a final finish reason, `message_stop`, a terminal stop reason) is now reported as a retryable network failure. Before, it ended quietly or as a plain error: a text answer that was cut short could be accepted as complete, and a cut tool call reached the model as a cut-off call. A stream that ends with its marker is unchanged.

  This reaches servers behind these drivers: an endpoint that closes a finished answer with only `[DONE]` and never sends a finish reason (`@namzu/openrouter`, `@namzu/http` on the OpenAI dialect) used to read as a finished answer and is now retried, and after the retries are spent the turn pauses. If your server behaves that way, make it send a finish reason on the last chunk. `@namzu/http` on the Anthropic dialect now requires `message_stop`. `@namzu/lmstudio` treats a reply with no stop reason as cut, and a reply that stopped because it failed or the model was unloaded as a server failure, where both used to be accepted as finished. If you test a driver with a fake stream, end it with the marker.

## 5.0.2

### Patch Changes

- dac0dd7: The Zen driver now says which of its models read images (`supportsImageInputFor`, from the catalogue), so a screenshot in a conversation no longer makes a text-only Zen model such as Beam refuse every later message.

## 5.0.1

### Patch Changes

- 9e63191: The terminal now retries a model call that fails for a reason that may pass (a dropped connection, a 5xx, an overloaded server, a rate limit with a short wait) instead of stopping after three tries. It tries ten times, waits from half a second doubling to thirty-two seconds with a little added on top, treats a `Retry-After` as a minimum, gives up on a wait longer than a minute (the reply then pauses and Enter tries again), and believes a provider that says `x-should-retry: false`. A reply cut off by a dropped connection starts over and the half-drawn text is taken back. While it waits, the Working row reads `Retrying in 5s · attempt 2/10` and counts down; Esc interrupts it. Nothing needs changing in your setup.

  SDK: `ProviderRetryConfig` gains optional `jitter` (`'full'` or `'proportional'`), `retryAfter` (`'exact'` or `'floor'`) and `retryMidStream`, `ProviderRetryNotice` and the `provider_retry` event gain an optional `restart`, `ProviderRequestError` gains `shouldRetry` (only `false` is acted on), `providerHttpError` takes `shouldRetry`, and `providerVendorError` reads `x-should-retry`. No default changed: `maxRetries` is still 3, jitter still full, `Retry-After` still exact, a stream that failed after output is still not retried unless a host sets `retryMidStream` (a host that does must drop what the failed attempt showed when it sees `restart`; the turn drops its own copy). Hosts that want the terminal's numbers pass them in `query({ retry })`.

  `@namzu/openai` (API key and Codex) and `@namzu/deepseek` gain an optional `maxRetries`, passed to the vendor SDK. Left unset, the vendor default of two silent retries still applies; set `0` to see and count each retry in the kernel, as the terminal does. `@namzu/openrouter`, `@namzu/google`, `@namzu/http` and `@namzu/zen` now pass the response's `x-should-retry` header to the error they throw.

## 5.0.0

### Major Changes

- 66eadb3: **Breaking: thirteen ids leave the bundled catalogue, because upstream stopped documenting or serving them.** `findZenModel` and `getZenModels` no longer return, on Zen, `deepseek-v4-flash`, `deepseek-v4-flash-vision-exp`, `cat-jam-free`, `step-5-preview-free`, `ling-3.1-flash-free` and `ling-3.0-flash-fin-free`, and on Go, `grok-4.6`, `kimi-k2.6`, `deepseek-v4-flash`, `deepseek-v4-flash-vision-exp`, `minimax-m2.7`, `step-5-preview-free` and `cat-jam-free`. A request naming one fails as an unknown model. Pick a current id instead — for a free Zen model, `glm-5.3-flash-free`, `deepseek-v4.1-flash-free` or `mimo-v2.6-flash-free`; on Go, `kimi-k3`, `minimax-m3` or `grok-4.7`. A host that has verified a wire for one of them can still pass `protocol` to the provider explicitly. The snapshot adds `glm-5.3-flash-free`, `deepseek-v4.1-flash-free`, `beam-free`, `ll-alpha-free` and `nemotron-3.5-super-vl-free` on Zen, and `gemini-4-argon-contributor`, `step-5-preview` and `beam-free` on Go.

  The runtime catalogue refresh works again. The Zen and Go documentation pages moved their endpoints to per-wire paths (`/inference/openai/…`, `/inference/anthropic/…`, `/inference/google/…` and their `go` variants), and `fetchZenCatalogue` rejected the whole run on the first such row, so every host fell back to its last saved or bundled list. It now reads those paths. A page row whose wire this driver does not implement is listed in `report.undecided` with its reason instead of failing the refresh. A row whose endpoint names a host other than the service's still rejects the run whole.

## 4.0.2

### Patch Changes

- d328c1b: Serve anonymous free-model calls from `https://opencode.ai/inference/v1` instead of the configured `https://opencode.ai/zen/v1`.

  The free-tier gateway answers `403 FreeTierError` — "OpenCode's free tier can only be used from within OpenCode" — to anonymous traffic on `/zen/v1`, and does so however faithfully the request is shaped. Measured on `cat-jam-free` with the OpenCode-shaped identity headers, the four injected tool names and a session and request id in the client's own format, both against the same session in the same minute: the same request is `403` on `/zen/v1/chat/completions` and `200` on `/inference/v1/chat/completions`. The request id's random half is not what the gateway reads — flipping it, keeping the timestamp half fresh or stale, and re-serialising the body all leave the verdict unchanged — only the route decides.

  To upgrade and keep working, nothing is required: anonymous free-model calls move to `/inference` by themselves, and every keyed call stays on `ZEN_BASE_URL` exactly as before. A caller-owned `baseURL` proxy is likewise untouched, and only the chat route is reachable anonymously — the Anthropic and Responses routes answer `401 Missing API key` on either host, as they did before. Verified live on `cat-jam-free`: a plain turn and a `bash` tool round both complete.

## 4.0.1

### Patch Changes

- 4a6ec17: Refuse to claim strict tool input generation where the wire would refuse the request.

  `edit` and `write` set `enforceModelInput`, and the Zen driver answered that with
  `strict: true` for both on the chat-class wires. The Zen free-tier gateway
  enforces the strict subset's structural rule itself — every object that declares
  `properties` must list all of them in `required` — and refuses the WHOLE request
  when one tool fails, so `edit`'s optional fields (a find-and-replace OR an
  insertion) took every other tool in the call down with it. `cat-jam-free` is the
  model that enforces; the symptom was `Invalid schema for function 'edit'`.

  - `@namzu/sdk` gains `acceptsStrictSchema(schema)`, the wider question a driver
    asks before claiming `strict: true` on one request: the keyword deny-list that
    `findStrictSchemaViolations` already runs, plus the structural rules, plus a
    guard for a tool that declared no schema at all (the deny-list walks nothing in
    `undefined` and finds nothing). It is additive; `findStrictSchemaViolations`
    and `assertStrictSchema` keep the registration-time job they had.
  - `@namzu/zen` now sends `strict: acceptsStrictSchema(...)` for a tool named in
    `enforceToolInputSchema`, so `write` keeps the guarantee and `edit` sends
    `strict: false`. Responses still sends `strict: false` for every tool, as it
    did. Nothing about a schema changes, and Namzu validates tool inputs before
    execution either way.
  - `edit`'s `insertLine` union branch `{ const: 'end' }` states no `type`, which
    the strict dialect has no spelling for; it is now `{ type: 'string', const:
'end' }`. The validator reports any union branch that never states a type.

  **What breaks.** A caller that relied on Zen sending `strict: true` for `edit`
  loses constrained decoding for that one tool on the chat-class wires. To keep it,
  the schema would have to require every field and make the optional ones nullable,
  which changes what `edit` accepts on every provider.

## 4.0.0

### Major Changes

- 2395a85: **Breaking: `fledge-alpha-free` leaves the bundled catalogue.** Zen no longer documents or serves it, so `findZenModel('zen', 'fledge-alpha-free')` and `getZenModels('zen')` no longer return it, and a request naming it fails as an unknown model. Pick another free Zen model, for example `step-5-preview-free` or `mimo-v2.6-flash-free`.
- 4367edc: Remove the default 4096-token per-call output ceiling when `maxTokens` is
  omitted. Requests now use the known model's advertised output ceiling instead
  of selecting a smaller service default by omitting the wire field. Unknown
  Chat, Responses and Google models without catalogue metadata leave the field
  omitted. Messages requires `max_tokens`, so an unknown Messages model without
  a known ceiling requires explicit `maxTokens` or model catalogue metadata.
  Explicit limits remain unchanged and include manual thinking tokens on Messages.

  Calls that relied on the previous default can produce longer output and consume
  more tokens. Set `maxTokens: 4096` explicitly, or `maxResponseTokens: 4096` on
  SDK turns, to preserve the previous behavior. Service and model limits still
  apply. This fixes Pal requests where Space Bunny spent the 4096-token allowance
  on reasoning and stopped before using tools, even with unlimited SDK turn guards.

- 0de3571: **Breaking: Zen Go's `space-bunny-free` leaves the bundled catalogue.** Go no longer serves that id, so `findZenModel('go', 'space-bunny-free')` and `getZenModels('go')` no longer return it, and a Go request naming it fails as an unknown model. On Go, use `space-bunny`, which the snapshot now carries. Zen's own `space-bunny-free` is unchanged.

  Zen now carries models that the service routes, prices and serves but that models.dev has not described yet, where it used to omit them. These models get conservative limits: 65,536 context, 8,192 output, text input, tool use on and no effort levels. They also get a new optional `ZenModel.limitsVerified: false`. Every other model leaves the field out, so existing code reads the same shape. Once models.dev publishes a model's limits, the entry uses them and the flag goes away. Tool use is assumed for these models, so one that cannot call tools fails when it runs. Models are still never carried when their price cannot be read or the service does not serve them, and a missing price never becomes zero.

  The free rule changed earlier without a changeset. Any Zen model priced at zero in the active catalogue is now offered without a key through the experimental request path, where previously only a fixed list of eight ids was. An id outside the old list used to be refused without a key; now it can be selected, though the gateway may still refuse it.

  The bundled snapshot adds `mimo-v2.6-flash-free`, `exo-free`, `fledge-alpha-free`, `ling-3.1-flash-free`, `grok-4.7`, `gpt-6.1-sol`, `claude-sonnet-5-5` and `claude-haiku-5-5` on Zen. On Go it adds MiMo V2.6 Flash and Pro, `claude-haiku-5-5` and `space-bunny`.

  `parseZenCatalogue` accepts `limitsVerified: false` in a stored copy and rejects any other value. An older `@namzu/zen` rejects any stored copy that contains the field and falls back to its bundled snapshot.

### Minor Changes

- 134932b: The bundled catalogue adds `step-5-preview-free` on Zen and on Zen Go, which both services now document and serve. Nothing else changes.

### Patch Changes

- 4367edc: Deliver screenshot and saved-image tool results to Chat Completions models as
  real, attributed image content after the complete tool-result batch. Previously
  these results failed local history conversion, despite the driver's advertised
  image capability, stopping Space Bunny Pal work after its first screenshot.

  Preserve original tool IDs, text and failure markers; leave the durable journal
  and operator messages unchanged. Images with persisted delivery omissions stay
  omitted, and text-only histories keep their previous request shape. The model
  must support image input; chat tool documents remain explicitly unsupported.

- 01b926c: Keyless Zen requests work again. The free-tier gateway now refuses every model that does not carry OpenCode's client identity — including `space-bunny-free`, which used to answer — and the driver was sending that identity only for a hand-picked `verified` path, so an anonymous call to `big-pickle` and to the new free models returned `FreeTierError`.

  Anonymous calls to the official Zen endpoint now all take the same path: an OpenCode `User-Agent` at 1.18 or newer (resolved from `OPENCODE_UA`, then an installed `opencode --version`, then a 1.18.35 floor), a descending `ses_` session id, the client and project headers, and the four tool names `bash`, `glob`, `grep` and `read` in the request body. The tool names are injected only where the caller registered none; a caller that has tools keeps its own set and its own `tool_choice`. Namzu's own attribution headers still travel on credentialed calls, on Zen Go, on a caller-owned `baseURL`, and on catalogue reads.

  Nothing in the public surface changes. Pass `OPENCODE_UA` if you want the advertised version pinned; without it the driver probes an installed binary once per process and falls back.

## 3.1.0

### Minor Changes

- f0505b5: Anonymous Zen users can now select all eight bundled free models instead of only Space Bunny. The seven previously blocked models use an experimental OpenCode-compatible request identity on the official Zen endpoint; Space Bunny keeps its verified direct request path, and keyed Zen and Zen Go requests are unchanged. Zen may still reject an experimental model or route, so a free catalogue entry is not a guarantee of service. The CLI labels this access as experimental and keeps Space Bunny as its default.

## 3.0.0

### Major Changes

- 29b142f: Zen Go no longer includes `glm-5.1`, `qwen3.6-plus`, or `qwen3.7-max` in its bundled supported model roster. The service still lists these IDs, but its current documentation provides no route or price for them. Applications relying on these IDs should select a documented model or, if they have independently verified the wire, configure `ZenGoProvider` with an explicit `protocol`. The CLI no longer offers these reviewed omissions.

  The default anonymous Zen model changes from `muse-spark-1.3-contributor-free` to `space-bunny-free` in both the SDK and CLI. Callers that need the old choice must pass `model: 'muse-spark-1.3-contributor-free'` explicitly and try credentialed Zen access, subject to gateway admission. The gateway currently rejects direct keyless Namzu requests to Muse and six other documented free models with HTTP 403; only Space Bunny Free completed a live keyless text and tool-continuation test. Anonymous model discovery now admits only that verified model while retaining the other free models for credentialed use.

  Zen and Zen Go now use the route overrides for DeepSeek V4 Flash and MiniMax, handle Muse Spark reasoning continuation without replaying gateway-bound ciphertext, and read the current Zen Go price table when refreshing the catalogue. These keyed routes have wire-fixture coverage but were not live-tested with an account. The CLI distinguishes model listing from verified inference and explains the gateway's specific HTTP 403 free-tier refusal.

## 2.5.2

### Patch Changes

- 567ada8: Updated package examples and evaluation fixtures for the SDK's `ToolRegistry`
  removal. Browser, computer-use and LSP documentation now show toolsets; the
  evals use `toolsets` when they call the kernel. Provider changes are test
  fixture migrations only, with no provider runtime API change. Consumers that
  pass tools to the SDK should use `toolsets: readonly Toolset[]` and wrap their
  definitions with `toolset(source, definitions)`.

## 2.5.1

### Patch Changes

- 49491b9: A response routed to an Anthropic-backed model that fills the model's context window now carries `finishDetail: 'context_window'` alongside `finishReason: 'length'`. `@ai-sdk/anthropic` folds both `max_tokens` and `model_context_window_exceeded` into `unified: 'length'`, keeping the original word only on `finishReason.raw`, which the driver did not read; the runtime auto-continues a plain `'length'` finish, sending a reply that had just filled the model's context window straight back in, in a prompt now longer than the window it had just overflowed. A plain output-limit `'length'` (`max_tokens`) is unaffected.
- 443094a: Native replay could be wrongly invalidated by `@namzu/sdk`'s new `BaseMessage.id` field: `createReplayState`'s `prefixDigest` hashed a message's earlier-turn prefix without excluding `id`, so two requests built from the exact same prefix content disagreed on the digest whenever one side was a fresh, never-recorded copy of the other (or a fork's copy, carrying a different session's id for identical content) — a real reasoning/tool-call replay would have been discarded and resent to the model as plain text for no content reason. `id` is now excluded from `prefixDigest` alongside `timestamp`, which it already ignored for the same reason.

## 2.5.0

### Minor Changes

- ab9108b: Derive the Zen and Go model catalogue at run time, opt-in. The new `@namzu/zen/catalogue` subpath exports `fetchZenCatalogue()`, which reads the same five sources the bundled snapshot is generated from (both documentation pages, models.dev and both `/models` answers) with a deadline and byte limit per source, and returns a whole validated catalogue plus a report, or rejects. It never returns a partial list. `buildZenCatalogue()` does the same derivation from texts you fetched yourself, and `parseZenCatalogue()` re-admits a stored copy strictly. A derivation is held to the same checks as a stored copy, so a result is never one its own saved copy would fail to read back.

  Pass the result as the new `ZenConfig.catalogue`, or a function returning it, and the provider checks it before the bundled snapshot for routing, anonymous admission, listing, context windows and effort levels. With a runtime catalogue, a served id that no source gives a wire format for is listed as `<id> (no known wire format)` and can be called only with an explicit `protocol`; the bundled snapshot's entry for such an id, if it has one, is not used. A model name carrying a control, format or line-separator character is refused, in a derivation and in a stored copy.

  Nothing changes unless you opt in. Importing the package, constructing a provider and `getZenModels`/`findZenModel` still read the bundled snapshot and make no network request. Without `catalogue`, `listModels()` returns what it did before. `ZEN_OMITTED_MODELS` (the reviewed omissions the snapshot was generated under) is now exported from `@namzu/zen` and `@namzu/zen/models`. The bundled roster is unchanged: 61 Zen and 28 Go models.

## 2.4.0

### Minor Changes

- 3e43fc2: The Go catalogue carries `grok-4.7` on the Responses protocol, as the Go page
  routes it. Four ids that both pages route but models.dev does not describe yet —
  `zen/grok-4.7`, `zen/mimo-v2.6-flash-free`, `go/mimo-v2.6-flash` and
  `go/mimo-v2.6-pro` — are not carried, because their limits cannot be derived. A
  caller that needs one names the protocol and limits itself.

### Patch Changes

- 3641102: On the Messages protocol, a cache request now places block-level breakpoints —
  after the static system text, and on the last message before request-only
  context — instead of the request-level `cacheControl` option, which the native
  adapter sends as a top-level `cache_control`. That is Anthropic's automatic
  caching, which puts its breakpoint on the last block: the request-only context
  at the tail, which the next request replaces, so no later request read the
  cached history. Other protocols are unchanged.

## 2.3.0

### Minor Changes

- 54429af: `muse-spark-1.3` no longer advertises the `max` reasoning effort.

  Upstream dropped it from the model's own menu, so a regeneration writes
  `['minimal', 'low', 'medium', 'high', 'xhigh']` where it wrote six values. A caller
  that passes `effort: 'max'` for this model is now refused with the refusal the
  driver has always given for an unadvertised level — _"The selected model does not
  advertise this reasoning effort level."_ Pass a lower level for this model, or use
  a model whose menu still carries `max`.

  **Why `minor` rather than `major`.** The catalogue's own rule, in
  [Zen and Zen Go](../../docs/sdk/zen.md), is that a removal is `major` _because a
  carried id stops resolving_; an addition or a repricing is `minor`. This model
  still resolves — `getZenModels()` and `findZenModel()` return it unchanged, its
  id, protocol, prices, context window and tool support are identical, and the
  public `ReasoningEffort` union in `@namzu/sdk` still carries `max` for the models
  that do advertise it. The page's rule has two buckets, and this is the one that is
  not a removal of a carried id: an addition, a repricing, or any other change that
  leaves a carried id resolving is `minor`. Nothing was removed from the API and no
  default changed.

  **No code changed.** The only edit is the generated catalogue, regenerated rather
  than hand-edited: `scripts/generate-zen-models.mjs` derives it from the live
  documents and `models.dev`, which is also what turned this into a red gate before
  anyone noticed by hand.

## 2.2.0

### Minor Changes

- 7b3323f: The Zen catalogue gains two models. They arrive in the same release as a
  generator fix that had to come first: the Zen page had started publishing a
  route row this script refused to read, and while that row stood the catalogue
  could not be checked against upstream at all.

  **New on Zen**, both selectable once your key admits them: `qwen3.8-flash` on
  the Messages wire at $0.15/$0.47 per million tokens, and `deepseek-v4.1-flash`
  on Chat Completions at $0.30/$1.20. Both were already carried on the Go
  service; upstream has since added them to the Zen route table as well, which is
  what made this roster move. Nothing was removed, no price changed, and
  `getZenModels`, `findZenModel`, `ZenModel` and `ZenProtocol` keep their
  signatures and types, so the bump is `minor`.

  **Two ids stay uncarried, and no longer stop the catalogue being checked.** The
  Zen page routes `jev-1.13` and `jev-1.13-free` on an endpoint whose AI SDK
  package column carries a dash rather than a package: the page names the model,
  its id and its endpoint, and no source states a wire for it — models.dev holds
  a name and limits for both and no package either. That row used to stop the
  generator as a page that had changed shape, which is the defect this release
  fixes: a row stating no wire is now read as exactly that, and both ids are
  omitted by name in `src/models.review.json` instead. The service does serve
  both, so if you call one of them the wire is yours to state — there is none to
  carry them on, which is the whole reason they are omitted — and that needs a
  real credential, because anonymous admission is only claimed for models the
  catalogue carries. The page's free-model list names `jev-1.13-free`; that is a
  statement upstream makes about it, not an anonymous access this driver grants.

## 2.1.1

### Patch Changes

- 8d5223b: Nothing a consumer installs or calls changes, and that is the whole of this
  release. `vitest` moves from `^3.2.6` to `^4.1.11` in the `devDependencies` of
  all nineteen packages that declared it, and `@vitest/coverage-v8` moves with it
  in `@namzu/sdk`. Every occurrence is a devDependency — checked, not assumed —
  so `dependencies`, `peerDependencies`, exports, types, defaults and the wire
  shape are untouched, and the published tarballs differ from the previous
  release only in `package.json#devDependencies`.

  The reason is a security fix with no 3.x backport. `GHSA-82fw-gwwq-j7x9`
  ("Path Traversal / Arbitrary File Read via `@vitest/mocker` Redirect Mock")
  covers `vitest` and `@vitest/mocker` from `2.1.0` up to `4.1.11`, so `^3.2.6`
  can only be resolved by leaving the 3.x line. `4.1.11` is the first patched
  release and is what the lockfile now resolves for both.

  What this costs anyone who works on the repository rather than with it: the
  upgrade was not a version bump. Vitest 4 changed test discovery, coverage
  configuration, mock construction and reporter output, and each of those broke
  something here that had to be migrated rather than worked around. Those fixes
  are all under `__tests__/`, `vitest.config.ts` files and `scripts/`, none of
  which is published, which is why this is a patch and not a major.

  You do not need to do anything. If you pin `vitest` yourself to run this
  project's own suites, note that the config files it ships are now written for
  `>= 4.1.11` and will not run under 3.x.

## 2.1.0

### Minor Changes

- a38d843: The catalogue was refreshed from its sources. The roster is unchanged — 59 Zen
  and 27 Go — so nothing a caller routes today stops resolving.

  **`gpt-5.6-sol` is repriced**: input `2.0` → `4.0`, output `10.0` → `20.0` per
  million tokens. The page had carried a 50% discount through 2026-09-18 and now
  states the full tier. A consumer that estimates cost from the bundled prices
  sees the increase here rather than at the invoice.

  **Two omissions were retired.** `zen/union-alpha` and `go/union-alpha` were
  recorded as omissions on 2026-09-18 after models.dev deleted their entry —
  the catalogue derives limits, tool support and modalities from there and never
  invents them. Hours later the service stopped serving the id and both pages
  stopped routing it, so the omission no longer applied and the stale rule
  dropped it. Neither id was ever carried, so this changes no caller's roster; it
  is recorded because a decision in `models.review.json` is re-examined on every
  run rather than left standing.

## 2.0.0

### Major Changes

- 565ffa7: The Zen catalogue tracks upstream again, and the roster it returns has moved.
  **The incompatible part is one removal**, not the refresh: `omen-alpha` is gone
  from the Go roster, so a caller that pins it by name now gets a refusal where
  it used to get a request.

  **`omen-alpha` is still served.** The service answers it on Go exactly as it
  answers a model that is carried — `401 AuthError "Missing API key"`, the same
  answer `kimi-k3` gives, where an id it does not know answers `401 ModelError
"Model no-such-model-xyz is not supported"`. What changed is that the Go page
  no longer ROUTES it, and a route is the one thing that cannot be derived: the
  service's own `/models` answer carries an id and nothing about how to call it.
  So the catalogue stops claiming a wire for it. If you depend on it, you can
  keep calling it by supplying the wire yourself — `new ZenGoProvider({ apiKey,
model: 'omen-alpha', protocol: 'chat' })` — and the driver will route it, as
  `client.ts` documents for any id whose protocol the host states explicitly.
  That is the only way to keep it, and it is a statement about a model nothing
  upstream documents any more.

  **One model is new**, and selectable once your key admits it:
  `deepseek-v4.1-flash` on Go (Chat Completions, $0.15/$0.60 per million
  off-peak).

  **`union-alpha` is not in this catalogue, and not for our reasons.** It was
  added to the roster while this release was being prepared, and upstream removed
  it before the release shipped: models.dev — where the catalogue derives limits,
  tool support, modalities and effort options — deleted its entry on 2026-09-18,
  from every provider that carried it and not only from ours. Nothing about the
  service changed, and nothing here is invented to compensate: a model whose
  limits cannot be derived is omitted rather than carried with made-up numbers.
  **You lose nothing by it.** The published `@namzu/zen` 1.0.2 does not carry this
  id either, and the roster this release ships is back to 86 models (59 Zen, 27
  Go); if the free-model list in the docs made you expect it, that is the
  explanation. Both services still serve it and both pages still route it on the
  Messages wire, so you can call it the same way as any id whose wire the host
  supplies — `new ZenProvider({ apiKey, model: 'union-alpha', protocol: 'messages' })`
  — which needs a real credential, since anonymous admission is only claimed for
  models the catalogue carries. It comes back on its own, at `minor`, when
  models.dev restores the entry.

  **Two Go prices are lower**, because upstream repriced them: `deepseek-v4-flash`
  and `deepseek-v4-flash-vision-exp` move from $0.22/$0.66 to $0.15/$0.60 per
  million input/output. Reported cost and anything you set `costLimitUsd` to are
  affected downward. These are estimates for SDK accounting, not invoices.

  Everything else is unchanged: `getZenModels`, `findZenModel`, `ZenModel` and
  `ZenProtocol` keep their signatures and types, and every model that was already
  carried keeps its protocol.

  **For future refreshes:** additions and repricing are `minor`, because a
  consumer's code keeps working. A refresh that DROPS an id is `major`, for the
  reason above — a pin on that name stops resolving — and it should always say
  which id and why, as this one does. The scheduled refresh derives that intent
  from the generator's own report rather than from anybody's judgement, and puts
  it in the pull request it opens, so a refresh cannot be merged as a change
  nobody is ever asked to release.

  `src/models.ts` is now generated by `node scripts/generate-zen-models.mjs`
  from the two service documentation pages, from models.dev, and from the two
  services' own `/models` answers, rather than a snapshot pinned to a revision.
  `src/models.review.json` records the curation decisions, and the CI gate
  **Zen catalogue matches its source** fails, naming the model, whenever a
  service documents OR SERVES one the catalogue neither carries nor omits. That
  second half is why the roster moved: the service answers 71 ids on Zen and 38
  on Go, and twelve of them — three on Zen, nine on Go, the free
  `deepseek-v4-flash-free` and `muse-spark-1.2-contributor-free` among them — are
  served while appearing on no page. None of the twelve is carried, because a
  model's wire is stated on a page and the `/models` answer carries an id and
  nothing else; each is now omitted by name with a reason, so `listModels()`
  dropping it is a recorded decision instead of a model nobody noticed. The gate
  also reads those two answers live, so a source it cannot reach is reported as a
  failure rather than passing quietly — the check runs in CI and needs the
  network to `opencode.ai`, which it has.

  **The catalogue does not update itself, and nothing here says it does.** A
  refresh is one command: it fetches, rewrites the module if the roster moved,
  and prints what it added, removed and repriced. What is new is that staleness
  is loud and the refresh is proposed: the scheduled
  `.github/workflows/zen-catalogue-refresh.yml` runs that command daily and opens
  a pull request when upstream has moved, carrying the generator's own report and
  the list of served ids that need curating. A person reviews and merges it —
  nothing is written to `main` by the job, and nothing is curated by it.

  Unchanged, and worth knowing before you file it as a regression: the service
  currently refuses anonymous use of every free model — including
  `muse-spark-1.3-contributor-free`, which an earlier release verified working —
  with HTTP 403 `FreeTierError`, "OpenCode's free tier can only be used from
  within OpenCode". That is upstream admission policy and predates this release;
  the catalogue still records the free models the pages publish, and the
  providers documentation now says so with the date and the evidence.

## 1.0.2

### Patch Changes

- 6551d15: Fix two error-classification bugs in the Zen driver that could misreport a genuine upstream failure (`overloaded`/`5xx`) as an unreachable-network one, or an unreachable-network one as an upstream server failure, depending on how the connection actually failed.

  - **A connection Zen's own SDK layer never got any HTTP response on (a transport failure such as `ECONNREFUSED`, or a proxy reset) is now classified `provider.network` ("could not reach the provider"), not `provider.unavailable` ("the provider is failing on its own side").** The driver used to default a missing status code to a fabricated `502`, which read as a genuine 5xx from the provider and pointed an operator at "resume once it recovers" for a request that in fact never reached the wire at all.
  - **A client-side timeout or aborted request (what a `fetch` call rejects with when `AbortSignal.timeout` fires — the shape behind Zen's free/anonymous models occasionally not answering in time) now keeps the platform's real reason in the error's `detail`** instead of the generic fallback "The model stream failed." (`message`/`name` on that rejection live on the prototype, not as own properties, and the driver's own fingerprinting was reading only own properties).
  - **Every classified failure from a `chatStream` call now names the model in its message and `detail`** (e.g. `model "big-pickle": …`), so a run juggling more than one model — or a log line read without the status line above it — still says which request failed. `providerId` (`"zen"` / `"zen-go"`) is unchanged; nothing keys on it differently.

  No public API changes. Nothing here indicates a Zen catalogue problem: `big-pickle` and every other listed model are unaffected by this fix, which only corrects how an already-thrown failure is classified and described.

## 1.0.1

### Patch Changes

- 2869fbe: Encode Responses requests with `toolChoice: 'none'` by omitting both tool definitions and the tool-choice field. This preserves the no-tools constraint while avoiding a Muse HTTP 400 during budget/time finalization. Required and named tool choices remain explicit, and other protocol routes retain their encoding.

## 1.0.0

### Major Changes

- c635b5a: Use `namzu --output-schema /absolute/path/schema.json` for native schema-constrained TUI answers. Unsupported or lossy schema conversion fails at launch; normal conversations remain unchanged. Supply the flag again on resume.

  Enable native query admission for Codex, OpenRouter, DeepSeek, HTTP and Zen wire mappings. Codex forwards Responses text.format; HTTP maps schemas for both dialects. Zen messages requests use native format instead of hidden tool fallback, and Google requests preserve JSON Schema constraints. Endpoint/model support is still required and vendor errors remain errors.

  Breaking for direct HTTP/Zen callers: an Anthropic-dialect response format can no longer be silently ignored or fall back to an output tool. Schema-free JSON and explicit strict:false are rejected. Use strict native JSON Schema on a capable model, or choose SDK structuredOutput.mode="tool" when native schema output is unavailable.

  Anthropic transport retries now default to zero instead of the vendor SDK default of two. The host immediately receives classified HTTP 429 responses with Retry-After metadata instead of waiting invisibly inside the vendor client. Set AnthropicConfig.maxRetries to 2 to retain the former transport retry behavior.

  Rate-limit guidance no longer claims automatic retries were exhausted when retry policy may have disabled them or refused the requested delay.

### Minor Changes

- 0795da3: Add optional Zen and Zen Go providers for OpenCode's services using Namzu's
  existing model contract. Exact service/model catalogue entries select Chat Completions,
  Responses, Anthropic Messages or Google streaming transport. Tool
  continuations, native reasoning metadata, conversation attribution,
  cancellation and classified provider errors remain part of the normal
  Namzu kernel lifecycle.

  The CLI exposes Zen (`zen`) and Zen Go (`zen-go`) in provider selection and
  headless runs. Zen supports anonymous public models and optional credentials;
  Go requires its own key. The actual Namzu
  conversation is retained for service attribution across turns and resume.
  The driver requires Node.js 20+ and a supported public model, or a real key
  with a known model or explicit protocol. Bundled prices are estimates;
  unsupported controls and content combinations are refused.

- 4cac9ca: Enable Zen's current public models without requiring an account key or an
  OpenCode installation. Anonymous SDK calls and the CLI's Zen default use
  `muse-spark-1.3-contributor-free`. Omitted, blank or `public` Zen keys select
  anonymous access, restricted to six explicitly supported free model IDs;
  paid or unknown models still require a real key. The SDK keeps
  `glm-5.3-flash` as the default for credentialed Zen and Go calls, and Go
  continues to require its own API key.

  The CLI uses environment keys first, then reuses separate `opencode` and
  `opencode-go` API-key entries from `OPENCODE_AUTH_CONTENT` or OpenCode's
  data-directory `auth.json`, including the paired Windows home on WSL when
  no absolute XDG override is supplied.
  It leaves that file unchanged and does not reinterpret OAuth records as
  API keys. Explicit `OPENCODE_API_KEY=public` selects anonymous access and
  suppresses secondary Zen key aliases and stored account keys. With no
  credential, Zen appears as public access without a login
  or key prompt. Public model availability and service limits remain under
  the upstream service's control.

  Expose `@namzu/zen/models` for catalogue functions and model types without
  loading the four native transport adapters during provider selection.

  Send `strict: false` for all Responses function tools so optional parameters,
  including nested read/edit fields, remain optional. This fixes HTTP 400
  schema rejection when a backend defaults omitted strictness to true.
  Responses also declines the capability-dependent `enforceToolInputSchema`
  hint for these general schemas; Namzu continues to validate inputs before
  tool execution. Other protocols retain their existing enforcement behavior.
