Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions docs/specs/2026-09-20-catalog-freshness.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ Provider-side resolution (2026-09-20): the availability filter shipped in `fix(c

The public `GET https://api.commandcode.ai/provider/v1/models` response is the availability authority at synchronization time. The extractor output, which is metadata read from the Command Code CLI bundle only, remains the metadata authority for fields that the endpoint does not provide.

The publishable catalog is the exact-ID intersection of:
The publishable catalog is the union of:

- candidate entries produced from the selected Command Code CLI bundle; and
- IDs in the availability response's `data` array.
- the exact-ID intersection of candidate entries produced from the selected Command Code CLI bundle and IDs in the availability response's `data` array; and
- API-only entries: availability IDs with no CLI candidate that the official pricing page lists (see [Official pricing page](#official-pricing-page)).

Matching is case-sensitive and exact. Display names and suffixes must not be used to infer availability.
Availability matching is case-sensitive and exact. Display names and suffixes must not be used to infer availability; an API-only entry always carries the exact availability ID.

API-only IDs are not synthesized because they lack the required provider metadata. They enter the published catalog only after the extractor produces a matching candidate.
API-only entries are synthesized from the live availability item (ID, display name, `context_length`, `supported_endpoints`), the official pricing row (billed rates, context tiers, `contextWindow`, `caps.vision`, `caps.reasoning`, `category`) and models.dev metadata. They have no CLI-only fields (reasoning effort lists) and use a 65,536-token output cap bounded by the context window. Their IDs are listed, sorted, in `manifest.review.apiOnly` for maintainer review. An availability ID with neither a CLI candidate nor an official pricing row is not published. No model rows or API-only ID lists are hardcoded.

An extracted model absent from the availability response is unavailable. It must:

Expand Down Expand Up @@ -94,6 +94,18 @@ Cost and modality enrichment runs only for the filtered catalog. `manifest.model

The unavailable list is sorted by ID so repeated synchronization is deterministic.

### Official pricing page

`https://commandcode.ai/docs/resources/pricing-limits` embeds every model row (`id`, `name`, `category`, `contextWindow`, `caps`, `deal`, `tiers` or `contextTiers`) in its Next.js flight payload. Synchronization decodes the `self.__next_f.push` chunks and parses the `rows` array.

- Rows join availability items by exact ID, then by the vendor-less ID ignoring case and punctuation (`Qwen/Qwen3.7-Max` ↔ `qwen-3.7-max`), then by display name. A key shared by two rows never matches. This join selects pricing data only; it never makes an ID available.
- `contextWindow` is the catalog context authority. The live `context_length` is a cross-check: a disagreement is reported as a warning in the run log and the GitHub step summary.
- Costs use the billed `rates` (deal prices), never `listRates`, including `cacheWrite` when present. The first band is the base cost; each later band becomes a context tier priced above the previous band's upper bound (`≤ 32K` then `≤ 256K` then `> 256K` gives tiers at 32,000 and 256,000 tokens). A band billed like the previous band adds no tier.
- For a model with an official row, official rates and tiers replace every other cost source, and models.dev context tiers are not applied. Models without an official row keep the existing waterfall (CLI, official table, free SKU, models.dev, models.dev tiers).
- Official cost rows are counted under `costSources.officialDocs`.

If the page cannot be fetched or no `rows` array with at least two priced models parses, synchronization fails soft: it writes no generated artifact, exits zero, and appends a warning to the log and to `$GITHUB_STEP_SUMMARY`. The previous committed artifacts remain the published catalog.

### Mutable OpenCode plugin packages

OpenCode V2.0.18 loads a warm cached package at startup and does not silently replace it. An isolated local startup with a cached Command Code 0.9.1 package loaded 0.9.1 even though npm `latest` was 0.10.1. A clean cache does install the latest package. OpenCode's current V2 plugin documentation describes startup update checks without changing the installed package; the host's update action must be applied before a restart loads the new code. V1.18.30's `opencode plugin <module> --global --force` explicitly refreshes a global package.
Expand Down Expand Up @@ -136,6 +148,10 @@ This preserves deterministic startup and offline use. Freshness is delivered by
- Static or dynamic Command Code hiding requires no special parser handling when the hidden ID is absent from the API.
- An unavailable, malformed, empty, duplicate-ID, or below-floor response leaves all generated artifacts byte-for-byte unchanged and exits non-zero.
- Cost, reasoning, and manifest counts are computed from the filtered catalog.
- The official pricing-page fixture parses every embedded row, and its rows join all 111 live IDs of the matching availability fixture.
- Official prices replace third-party tiers: `claude-sonnet-4-6` is flat 3/15 with no 200K tier, `gpt-5.5` is flat 5/30 with a 400K context, MiniMax M3 bills 0.3/1.2, and Qwen 3.7 Max has no 32K or 128K tier.
- Live IDs without a CLI candidate are synthesized from the official row (for example `subquadratic/subq-savant-1.4` with a 4,194,304-token context and the free `recursive/flint-v1.1:free` and `reflection/beam-contributor:free` at $0) and listed in `manifest.review.apiOnly`.
- An unparseable pricing page leaves generated artifacts unchanged, exits zero, and records a step-summary warning.
- `bun run check` passes after generated artifacts are refreshed.

### OpenCode package refresh
Expand Down
17 changes: 12 additions & 5 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"schemaVersion": 1,
"generatedAt": "2026-12-04T18:34:26.642Z",
"generatedAt": "2026-12-04T19:03:51.789Z",
"pluginVersion": "0.12.56",
"commandCodeVersion": "1.94.0",
"commandCodeTarball": "https://registry.npmjs.org/command-code/-/command-code-1.94.0.tgz",
"modelCount": 106,
"reasoningModelCount": 95,
"modelCount": 111,
"reasoningModelCount": 100,
"extraction": {
"modelCatalog": "ok",
"costCatalog": "docs",
"costCatalogError": null
},
"costSources": {
"cli": 0,
"officialDocs": 106,
"officialDocs": 111,
"thirdParty": 0,
"free": 0,
"fallback": 0,
Expand All @@ -22,7 +22,14 @@
"review": {
"thirdParty": [],
"free": [],
"unmatched": []
"unmatched": [],
"apiOnly": [
"minimax/minimax-m4",
"recursive/flint-v1.1:free",
"reflection/beam-contributor:free",
"subquadratic/subq-savant-1.4",
"thinkingmachines/inkling-2-small"
]
},
"status": "healthy"
}
Loading