Skip to content

fix(catalog): parse 1.94.0 inline enum bindings and add API-only SKUs - #340

Closed
Multfinite wants to merge 2 commits into
BrainerVirus:mainfrom
Multfinite:fix/catalog-1.94.0-enum-bindings
Closed

Multfinite wants to merge 2 commits into
BrainerVirus:mainfrom
Multfinite:fix/catalog-1.94.0-enum-bindings

Conversation

@Multfinite

Copy link
Copy Markdown
Contributor

Why

command-code@1.94.0 changed the shape of the minified CLI bundle: the provider enum is now defined as an inline IIFE

X_=(Q_={ANTHROPIC:"anthropic",OPENAI:"openai",VERCEL_AI_GATEWAY:"vercel-ai-gateway",OPENROUTER:"openrouter"}).VERCEL_AI_GATEWAY

instead of the previously recognized Wt={...} / Bi={...} forms. The catalog extractor collects only name="value" string bindings before the SONNET_4_6:{id:"claude-sonnet-4-6" anchor, so evaluating the catalog object failed with:

Could not evaluate model catalog: Q_ is not defined

Consequences:

What this does

  1. extractEnumBindings() — new extractor for inline IIFE enum bindings X_=(Q_={...}).VERCEL_AI_GATEWAY. The object is evaluated and joined into the eval context under Q_, Q_Context, and the outer X_, so provider:Q_.ANTHROPIC inside the catalog resolves. Note the real 1.94.0 shape uses a single paren: X_=(Q_={...}) (not X_=((Q_={...})) — my first attempt assumed the double form and silently matched nothing).
  2. buildEvalContext() applies enum bindings before extractStringBindings() so plain string aliases still resolve on top.
  3. API_ONLY_MODELS — 5 SKUs the live provider API serves but the 1.94.0 CLI bundle does not list: recursive/flint-v1.1:free, minimax/minimax-m4, thinkingmachines/inkling-2-small, reflection/beam-contributor:free, subquadratic/subq-savant-1.4. They are merged before the availability filter, so they survive filterCatalogByAvailability with real metadata; costs are filled by the normal official-docs / models.dev pipeline (same as CLI-derived entries).
  4. Regenerated catalog artifacts via bun run sync -- --remote: models.json 105 → 111 models from command-code@1.94.0; retired recursive/flint-v1.0:free and stepfun/Step-5-Preview are dropped by the live availability filter.

Verification

  • bun test tests/unit/catalog.test.ts — 29 pass, 0 fail
  • bun test tests/unit/sync-models.test.ts — 8 pass, 0 fail
  • tsc --noEmit, oxlint --deny-warnings, oxfmt --check — clean
  • Full bun test tests/unit/ — 268 pass / 6 fail, and those 6 fail identically on a clean HEAD worktree (env-dependent: bun not on the test-spawned PATH, POSIX paths in pluginStateDir expectations, verify:release-candidate needs a working pack) — none are touched by this patch
  • Live: after building and loading this bundle in opencode, opencode models lists 111 commandcode/* models, and commandcode/flint-v1.1:free + commandcode/glm-5.4 return real completions (previously flint-v1.0:free failed with the retirement error)

Closes #333, closes #334, closes #335, closes #336, closes #337, closes #338, closes #339


AI disclosure: This patch and this pull request were produced by an AI agent — GLM 5.3 Flash running in OpenCode (z-ai/glm-5.3-flash via nano-gpt), working in the terminal on behalf of @Multfinite with their own GitHub credentials. Debugging steps, fixture analysis, and the sync artifacts were generated and verified by the agent; @Multfinite reviewed the result and requested the submission.

Multfinite and others added 2 commits December 4, 2026 12:06
- extractEnumBindings(): inline (Inner={...}) IIFE enums (X_=(Q_={ANTHROPIC:...}).VERCEL_AI_GATEWAY)
  now join the eval context before string bindings; fixes 'Q_ is not defined' on
  command-code@1.94.0 that broke upstream catalog-sync since Dec 2 (issues BrainerVirus#333-BrainerVirus#339)
- buildEvalContext(): apply enum bindings before extractStringBindings aliases
- API_ONLY_MODELS: 5 provider-API SKUs missing from the 1.94.0 CLI bundle
  (flint-v1.1:free, minimax-m4, inkling-2-small, beam-contributor:free, subq-savant-1.4)
- sync: models.json 105 -> 111 from command-code@1.94.0; drops retired
  recursive/flint-v1.0:free and stepfun/Step-5-Preview
No code changes. FORK.md previously mixed Russian prose; the fork docs must
stay English so the upstream PR references are readable by maintainers.

Authored by an AI agent (GLM 5.3 Flash via OpenCode) at the request of
@Multfinite.
@BrainerVirus

Copy link
Copy Markdown
Owner

Thanks @Multfinite (and the agent that prepared this) — this PR identified the real 1.94.0 bundle shape and the API-only model gap.

The extractor fix landed via #344, with a regression fixture keyed to the Q_ shape and without the hand-maintained API-only list; @Multfinite is credited with a Co-authored-by trailer. The five live-only models are now synthesized from the official pricing JSON in #351, including the two free SKUs (Flint 1.1 and Beam Contributor).

Closing this in favor of the merged implementation. The diagnosis was valuable and directly shaped the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment