commandcode 0.1.14: a Zero Data Retention switch sends x-cmd-zdr: 1 on the Provider API and Go's /alpha/generate (#246)
moonshardx (#246): Command Code keeps request content up to 30 days unless Zero Data Retention is asked for (commandcode.ai/docs/resources/ zdr): CMD_ZDR=1 for the CLI, x-cmd-zdr: 1 on the Provider API. The plugin had no way to send it. - The plugin declares a "Zero Data Retention" switch (auth.options, magpie #2038, off by default, with a cost note to confirm). magpie shows it in the provider's editor; the plugin reads it through input.magpie.option at each request, so no restart is needed. CMD_ZDR=1 in the plugin process's environment also turns it on, as for the CLI; only "1" does, as the CLI's isCmdZdrEnabled reads it. - While on, the Provider API request and Go's /alpha/generate request each carry x-cmd-zdr: 1. For /alpha/generate this mirrors the CLI: its 1.84.0 bundle (npm pack, read, not run) adds [CMD_ZDR]:"1" in buildCommandAuthHeaders, and the installed CLI 1.74.1, run with CMD_ZDR=1 in a sandbox HOME through a logging pass-through proxy (COMMANDCODE_SANDBOX=true, COMMANDCODE_API_URL), sent x-cmd-zdr=1 on /alpha/generate and on every other request. - A model with no ZDR upstream: the Provider API's 422 cmd_zdr_no_providers goes on as it came. On /alpha/generate Command Code answers 200 with an error line ({"type":"cmd_zdr_no_providers","code": "CMD_ZDR_NO_PROVIDERS","statusCode":400}); the agent gets that 400 and message as before, and now the error's type cmd_zdr_no_providers instead of commandcode_error. Run: zdr.test.mjs is new (6 tests, fixtures are Command Code's literal bodies from today). Broke each by hand and watched red: no option, no Provider header, no generate header, CMD_ZDR read as truthy, the switch read once, the 422 rewritten, the type dropped: 1 to 3 fail each. bun test packages/commandcode: 55 pass, 1 skip, 0 fail. bun scripts/check.mjs commandcode: ok. HOME=$(mktemp -d under $TMPDIR) bun test: 1822 pass, 0 fail. Live, with the owner's GOAT key, the plugin's fetch with the switch on: Provider API deepseek-v4-flash 200 with x-cmd-zdr: 1; Provider API poolside/laguna-s-2.1-free 422 cmd_zdr_no_providers, body as it came; /alpha/generate (plan forced to Go) deepseek-v4-flash 200 with the header, laguna 400 cmd_zdr_no_providers; with the switch off neither had the header. Not tried: a real Go account (none here), the switch in magpie's editor itself (driven by a stand-in for input.magpie), OpenCode.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@magpie-community/opencode-commandcode-auth",
|
||||
"version": "0.1.13",
|
||||
"version": "0.1.14",
|
||||
"description": "Command Code plans (Pro, GOAT, Max, Ultra, Go, Teams) in OpenCode and magpie",
|
||||
"type": "module",
|
||||
"main": "./index.mjs",
|
||||
|
||||
Reference in New Issue
Block a user