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:
@@ -4,6 +4,13 @@
|
||||
import { afterEach, expect, test } from "bun:test"
|
||||
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
|
||||
@@ -183,7 +190,7 @@ test("a model served on Responses and not chat completions is asked on Responses
|
||||
}
|
||||
const a = { ...api, metadata: { plan: "Max" } }
|
||||
const hooks = await CommandCodePlugin()
|
||||
const ms = await hooks.provider.models({ models: {} }, { auth: a })
|
||||
const ms = talking(await hooks.provider.models({ models: {} }, { auth: a }))
|
||||
expect(Object.fromEntries(Object.entries(ms).map(([k, m]) => [k, m.api.npm]))).toEqual({
|
||||
"gpt-6-sol": "@ai-sdk/openai",
|
||||
"moonshotai/Kimi-K3": "@ai-sdk/openai-compatible",
|
||||
|
||||
Reference in New Issue
Block a user