commandcode 0.1.18: Jev (typesafe/jev), Command Code's decision model, can be picked in magpie

joeliu96872540 on X: magpie couldn't get Command Code's typesafe/jev.
Command Code's /provider/v1/models (94 models) doesn't list it; the CLI
(command-code 1.88.2, read from its bundle, not run) knows it as
SYSTEM_ONE_MODELS ["typesafe/jev"], asked at POST /provider/v1/systemone
with {model, state, questions} and buildCommandAuthHeaders, answered with
{model, answers, usage}. That is magpie's System One shape.

- config sets decide: true on the provider and adds Jev to its models,
  marked decides (magpie's plugin decision API, yetone/magpie#1514).
- provider.models adds Jev, marked, to every plan's list (Go's, the live
  one, the default standing in); Command Code decides which plans may ask.
- fetch sends a /systemone question as the CLI does: its headers
  (User-Agent cli, x-command-code-version 1.88.2, project slug, session,
  Bearer key, x-cmd-zdr when ZDR is on), not the chat's x-api-key, with
  Jev's other names (jev, jev-latest, typesafe-ai/jev) sent as
  typesafe/jev. The answer goes back as it came; a refusal through
  failure(), the account kept; a Go plan's "no API access" keeps the key
  as Go's.
- The plan-list tests that count chat models leave Jev out (talking()).

Run: bun test in packages/commandcode on mote: 72 pass, 1 skip (as
before), 0 fail; bun scripts/check.mjs all green. Broken by hand (the
/systemone branch, decide and withJev turned off): 6 of jev.test.mjs's 8
go red; the ZDR and Go-refusal cases pass either way, as the generic
Provider API path does the same for them.

Not tried: a real Command Code account (none in a sandbox HOME), so no
real /systemone answer has been seen, nor which plans Command Code lets
ask Jev.
This commit is contained in:
yetone
2026-10-29 14:52:38 +08:00
parent 644038d95a
commit dec921767e
8 changed files with 274 additions and 13 deletions
+9 -2
View File
@@ -10,6 +10,13 @@ import { readFileSync } from "node:fs"
import { join } from "node:path"
import { CommandCodePlugin, _internal } from "./index.mjs"
// talking leaves out the decision model (Jev, jev.test.mjs), which every
// plan's list has beside the models it talks to
const talking = (ms) => {
delete ms[_internal.JEV]
return ms
}
const real = globalThis.fetch
afterEach(() => {
globalThis.fetch = real
@@ -34,7 +41,7 @@ async function models(reply) {
return new Response("", { status: 404 })
}
const hooks = await CommandCodePlugin()
const ms = await hooks.provider.models({ models: {} }, { auth: go })
const ms = talking(await hooks.provider.models({ models: {} }, { auth: go }))
return { ms, asked }
}
@@ -98,7 +105,7 @@ test("a model says it takes pictures when known, and nothing when not", async ()
return new Response("", { status: 404 })
}
const hooks = await CommandCodePlugin()
const ms = await hooks.provider.models({ models: {} }, { auth: pro })
const ms = talking(await hooks.provider.models({ models: {} }, { auth: pro }))
expect(Object.keys(ms).length).toBe(86)
const said = (id) => ms[id].capabilities.input.image
// Claude, the default list's and the CLI's table's