feat(models): move manual reasoning efforts into a catalog override
PR #69 added efforts for meta/muse-spark-* directly to the generated catalog, which the drift check flags and the daily sync job reverts. Keep src/commandcode-catalog.ts byte-identical to upstream and merge a separate src/commandcode-catalog-overrides.ts over it at load time. A test fails as soon as upstream publishes efforts for an overridden model so the override gets removed instead of shadowing the CLI catalog. Verified against the live endpoint: pi --thinking xhigh sends reasoning_effort="xhigh" for meta/muse-spark-1.2-contributor and the request succeeds; --thinking off sends none. Closes #69
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import type { CommandCodeReasoningEffort } from "./commandcode-catalog.ts"
|
||||
|
||||
/**
|
||||
* Manual reasoning-effort policy for models the official CLI marks as
|
||||
* reasoning-capable without publishing selectable efforts.
|
||||
*
|
||||
* `src/commandcode-catalog.ts` is generated from the CLI package and must stay
|
||||
* byte-identical to upstream so the daily drift check works. Entries here are
|
||||
* merged over the generated catalog at load time and are not touched by
|
||||
* `npm run sync:commandcode-catalog`.
|
||||
*
|
||||
* Add a model only when the effort parameter is known to be accepted by the
|
||||
* Command Code endpoint; remove it once the CLI catalog ships its own efforts.
|
||||
*/
|
||||
export const MODEL_EFFORT_OVERRIDES: Readonly<
|
||||
Record<string, readonly CommandCodeReasoningEffort[]>
|
||||
> = {
|
||||
// Meta Muse Spark: the CLI ships no effort levels, but the endpoint accepts
|
||||
// `reasoning_effort` for these models and other hosts expose the same set.
|
||||
"meta/muse-spark-1.1": ["minimal", "low", "medium", "high", "xhigh"],
|
||||
"meta/muse-spark-1.2": ["minimal", "low", "medium", "high", "xhigh"],
|
||||
"meta/muse-spark-1.2-contributor": ["minimal", "low", "medium", "high", "xhigh"],
|
||||
}
|
||||
@@ -133,9 +133,6 @@ export const MODEL_EFFORTS: Readonly<Record<string, readonly CommandCodeReasonin
|
||||
"gpt-5.6-sol": ["low", "medium", "high", "xhigh", "max"],
|
||||
"gpt-5.6-terra": ["low", "medium", "high", "xhigh", "max"],
|
||||
"moonshotai/Kimi-K3": ["low", "high", "max"],
|
||||
"meta/muse-spark-1.1": ["minimal", "low", "medium", "high", "xhigh"],
|
||||
"meta/muse-spark-1.2": ["minimal", "low", "medium", "high", "xhigh"],
|
||||
"meta/muse-spark-1.2-contributor": ["minimal", "low", "medium", "high", "xhigh"],
|
||||
"Qwen/Qwen3.8-27B": ["low", "medium", "xhigh"],
|
||||
"Qwen/Qwen3.8-Flash": ["low", "medium", "xhigh"],
|
||||
"Qwen/Qwen3.8-Max": ["low", "medium", "xhigh"],
|
||||
|
||||
+9
-2
@@ -1,8 +1,9 @@
|
||||
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises"
|
||||
import { dirname } from "node:path"
|
||||
|
||||
import { MODEL_EFFORT_OVERRIDES } from "./commandcode-catalog-overrides.ts"
|
||||
import {
|
||||
MODEL_EFFORTS,
|
||||
MODEL_EFFORTS as CATALOG_MODEL_EFFORTS,
|
||||
MODEL_INPUT_MODALITIES,
|
||||
MODEL_MAX_OUTPUT_TOKENS,
|
||||
MODEL_REASONING,
|
||||
@@ -10,7 +11,13 @@ import {
|
||||
type CommandCodeReasoningEffort,
|
||||
} from "./commandcode-catalog.ts"
|
||||
|
||||
export { MODEL_EFFORTS, MODEL_INPUT_MODALITIES, MODEL_MAX_OUTPUT_TOKENS, MODEL_REASONING }
|
||||
/** Upstream CLI efforts with the manual overrides merged over them. */
|
||||
export const MODEL_EFFORTS: Readonly<Record<string, readonly CommandCodeReasoningEffort[]>> = {
|
||||
...CATALOG_MODEL_EFFORTS,
|
||||
...MODEL_EFFORT_OVERRIDES,
|
||||
}
|
||||
|
||||
export { MODEL_INPUT_MODALITIES, MODEL_MAX_OUTPUT_TOKENS, MODEL_REASONING }
|
||||
export type { CommandCodeInputType }
|
||||
|
||||
export const DEFAULT_PROVIDER_API_BASE = "https://api.commandcode.ai/provider/v1"
|
||||
|
||||
Reference in New Issue
Block a user