Feat/opencode zen provider#4467
Conversation
Represent provider wire selection as either fixed or model-aware. Resolve model-aware protocols from catalog endpoint keys and fail closed when an endpoint does not prove a supported request shape.\n\nExisting providers remain fixed-policy routes, so this creates the Zen routing seam without changing current provider behavior. Signed-off-by: snailoniu <snailoniu@gmail.com>
Register OpenCode Zen across config, CLI, secrets, and TUI surfaces with provider-scoped API key guidance. Keep its wire policy model-aware and fail closed until a catalog offering proves the selected model protocol. Signed-off-by: snailoniu <snailoniu@gmail.com>
Route the documented Zen catalog across Responses, Anthropic Messages, and Chat Completions by model. Normalize the official opencode/model selector and reject Gemini or unknown models until their request protocol is supported and proven. Signed-off-by: snailoniu <snailoniu@gmail.com>
Bind clients to the resolver-proven request protocol and send Zen models through Responses, Anthropic Messages, or Chat Completions as appropriate. Keep Zen on bearer authentication, exclude Codex OAuth headers, and fail closed when a request changes protocol or uses an unproven FIM route. Signed-off-by: snailoniu <snailoniu@gmail.com>
Document Zen as a separate API-key provider with model-scoped Responses, Messages, and Chat Completions groups. Record the unsupported Gemini boundary and teach the provider registry drift check about the manual model-aware provider implementation. Signed-off-by: snailoniu <snailoniu@gmail.com>
OpenCode Zen routes Anthropic models through the Messages API, which expects the native x-api-key header. Sending Zen keys as Authorization bearer tokens produced upstream 401 Missing API key errors for Claude models. Refresh the request-shape test to lock the Zen Messages auth dialect while keeping bearer auth for Zen Responses and Chat Completions routes. Signed-off-by: snailoniu <snailoniu@gmail.com>
The model-aware route guard now reports that the Anthropic-compatible route has no proven FIM wire contract. Keep the local-failure test aligned with that fail-closed behavior and continue asserting that no HTTP request is made. Signed-off-by: snailoniu <snailoniu@gmail.com>
|
Thanks @snail-vs for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
|
Intake note: this covers the OpenCode Zen half of #1481, which is milestone-assigned to v0.9.3 (the OpenCode Go half shipped in #4420; Zen + the Messages-protocol route follow in the v0.9.3 window). Setting the milestone accordingly — no action needed from you; we'll do the full review pass when v0.9.3 opens. Thanks for taking this on! |
|
Thanks — this is what a complete provider addition looks like: Where it stands: per the intake note, this is the Zen half of #1481 (Go shipped in #4420) and sits on the v0.9.3 milestone; v0.9.1 is freezing and v0.9.2 is the active lane, so the full review pass comes when v0.9.3 opens. The full CI matrix has not run on this head yet — fork PRs only get the intake gate and GitGuardian until review. To keep the branch landable in the meantime:
Related demand your work serves: #1481 and #4526. Generated by Claude Code |
Summary
x-api-key.Testing
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-featurescargo test --workspace --all-featuresFull workspace tests were run serially. One unrelated TUI test failed in the full suite but passed when rerun in isolation:
non_recoverable_engine_error_enters_offline_modeChecklist