Compare commits
No commits in common. "0872a2099bfbfe1f338b30fa2c020bf32f8a67c9" and "70b35d51640e8894e5d6228de38aee6ddd1ce753" have entirely different histories.
0872a2099b
...
70b35d5164
11
README.md
11
README.md
@ -163,17 +163,6 @@ The log captures the request (model id, body byte length), each HTTP attempt (st
|
|||||||
wait, elapsed ms), every stream event payload, and the terminal finish reason + usage. It is
|
wait, elapsed ms), every stream event payload, and the terminal finish reason + usage. It is
|
||||||
useful for diagnosing model selection, retry, tool-call, and finish-reason issues.
|
useful for diagnosing model selection, retry, tool-call, and finish-reason issues.
|
||||||
|
|
||||||
## ZDR header toggle
|
|
||||||
|
|
||||||
The `x-cmd-zdr: 1` request header is **omitted by default** because it is rejected by some
|
|
||||||
models. Set `COMMANDCODE_ZDR=1` (or `true`/`yes`) when launching opencode to opt back in. The
|
|
||||||
value is read once at provider load, so restart opencode after changing it. Per-provider
|
|
||||||
overrides still win: `headers: { "x-cmd-zdr": "..." }` in `opencode.json` takes precedence over
|
|
||||||
the environment variable.
|
|
||||||
|
|
||||||
With `COMMANDCODE_DEBUG` enabled, the trace logs a `zdr on|off` line per request so the toggle
|
|
||||||
state is observable.
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
| Capability | Status |
|
| Capability | Status |
|
||||||
|
|||||||
@ -23,10 +23,6 @@ import { redact } from "./redact.js";
|
|||||||
import { transform } from "./transform.js";
|
import { transform } from "./transform.js";
|
||||||
import { finishReasonFrom, usageFromFinish, type FinishEvent } from "./usage.js";
|
import { finishReasonFrom, usageFromFinish, type FinishEvent } from "./usage.js";
|
||||||
|
|
||||||
// x-cmd-zdr breaks some models; off by default (server.py never sends it).
|
|
||||||
// COMMANDCODE_ZDR=1|true|yes opts back in. Read at load, like COMMANDCODE_DEBUG.
|
|
||||||
const ZDR_ENABLED = /^(1|true|yes)$/i.test(process.env["COMMANDCODE_ZDR"] ?? "");
|
|
||||||
|
|
||||||
export type CommandCodeOptions = {
|
export type CommandCodeOptions = {
|
||||||
name?: string;
|
name?: string;
|
||||||
apiKey?: string;
|
apiKey?: string;
|
||||||
@ -143,10 +139,8 @@ class CommandCodeLanguageModel implements LanguageModelV3 {
|
|||||||
"x-project-slug": "project",
|
"x-project-slug": "project",
|
||||||
"x-taste-learning": "true",
|
"x-taste-learning": "true",
|
||||||
"x-co-flag": "false",
|
"x-co-flag": "false",
|
||||||
...(ZDR_ENABLED ? { "x-cmd-zdr": "1" } : {}),
|
|
||||||
...this.opts.headers,
|
...this.opts.headers,
|
||||||
};
|
};
|
||||||
debug("fetch", "zdr", ZDR_ENABLED ? "on" : "off");
|
|
||||||
const auth = bearer(this.opts.apiKey);
|
const auth = bearer(this.opts.apiKey);
|
||||||
if (auth) headers["Authorization"] = auth;
|
if (auth) headers["Authorization"] = auth;
|
||||||
for (const [k, v] of Object.entries(extra ?? {})) if (v !== undefined) headers[k] = v;
|
for (const [k, v] of Object.entries(extra ?? {})) if (v !== undefined) headers[k] = v;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user