Files
DeepSeek-TUI/config.example.toml
Hunter Bown c256dd8f83 fix(custom): wire = responses|anthropic for openai-compatible + opencode-zen muse-spark (rescue of #5716) (#5719)
* ci: add Windows x64 build workflow on push to main

* fix: trigger build-windows on any push to main

* fix(custom): support wire = "responses" | "anthropic" | "chat" for kind="openai-compatible"

Custom provider was fixed to ChatCompletions, ignoring providers.<name>.wire.
Now honors per-config wire in both client::provider_wire_format_for_config
and config::provider_capability, keeping Custom::wire_policy default as Chat
for compat. Aliases: responses/openai-responses/responses-api -> Responses;
anthropic/messages/claude -> AnthropicMessages; default -> Chat.

Fixes custom muse-spark-1.2 on opencode.ai/zen/v1 needing Responses.

* fix(opencode-zen): route muse-spark over Responses API

Muse Spark 1.2 contributor-free on https://opencode.ai/zen/v1 only
supports POST /v1/responses (Responses API) and rejects Chat Completions.
Previously the bundled offering roster and ModelAware resolver treated
unknown muse-spark variants as chat or failed closed to unproven, so
CodeWhale sent chat payloads that 404.

- Add muse-spark-1.2, -contributor, -contributor-free to
  OPENCODE_ZEN_RESPONSES_MODELS (bundled_offerings)
- Add resolver fallback: any muse-spark* under OpencodeZen resolves
  to endpoint_key responses even without exact catalog match
- Update config.example.toml docs (GPT/Muse Spark -> Responses) and
  add muse-spark-1.2-contributor-free example
- Add scripts/opencode-chat2responses-proxy.mjs as zero-Rust
  chat->responses shim for chat-only clients

Custom gateways can already use wire="responses" (ff504585a);
this fix makes the first-class opencode-zen provider work without
hand-written wire config.

* fix(client): keep codex env-token auth working on custom endpoints

PR #5716 diverted OpenaiCodex credential resolution to the generic key
resolver whenever provider_uses_custom_endpoint() is true, which dropped
an explicit OPENAI_CODEX_ACCESS_TOKEN for custom-base-url setups. The
shared-seam wiremock test proves the regression: the mock only answers
Bearer test-token, so the request came back 404 on all three CI OSes
(client::responses::tests::responses_stream_open_preserves_wire_headers_
through_shared_seam). The manual if-condition formatting also failed the
Lint job's cargo fmt --check.

Restore the pre-PR precedence by trying codex_credentials() first: env
credentials still win on custom endpoints (codex_credentials checks env
before the official-endpoint consent grant), the official endpoint keeps
propagating OAuth errors, and only a custom endpoint with no env token
falls back to deepseek_api_key() — preserving the contributor's goal of
letting a custom endpoint authenticate with its own configured key.

Signed-off-by: CodeWhale Bot <bot@codewhale.net>

* refactor(tui): route wire-dialect reads through one Config helper

The wire= feature read providers.<id>.wire in two places (client wire
resolution and the capability reporter), and provider_capability_with_
wire was exported but never called with a real value — a parallel entry
point that reported Chat for custom providers the client actually speaks
Responses/Messages to.

- Add Config::provider_wire_dialect() as the single trimmed, non-empty
  wire reader; use it in provider_wire_format_for_config and the doctor
  capability report (provider_capability_with_wire).
- Drop the over-broad '|| normalized.contains("responses")' from
  wire_config_prefers_responses in both modules: every listed alias
  except the singular 'response'/'response-api' spellings already
  contains the substring, so the fallback only admitted unintended
  values like 'not-responses'.
- Remove the vestigial 'let _ = provider_kind;' marker in the resolver
  arm that now genuinely uses provider_kind.

Signed-off-by: CodeWhale Bot <bot@codewhale.net>

* revert(ci): drop contributor-added build-windows workflow

The PR added a Build Windows x64 workflow triggering on every push to
main. That build is already covered: release-artifacts.yml builds both
x86_64-pc-windows-msvc and aarch64-pc-windows-msvc release binaries,
nightly.yml rebuilds them nightly, and ci.yml runs the full test matrix
on windows-latest. A fourth always-on Windows build only spends CI
minutes on every main push and grants the job an actions:write
permission it does not need. Contributor CI-workflow additions are
outside this feature's scope; restoring main's tree (no such file).

Signed-off-by: CodeWhale Bot <bot@codewhale.net>

---------

Signed-off-by: CodeWhale Bot <bot@codewhale.net>
Co-authored-by: whp233 <whp233@users.noreply.github.com>
Co-authored-by: CodeWhale Bot <bot@codewhale.net>
2026-08-31 17:53:16 -07:00

98 KiB