Skip to content

Commit 7aa64bb

Browse files
lidge-junjun
andauthored
feat(cursor): derive the picker seed from the capability table and label every row (#3222)
* docs(cursor): diff-level roadmap for unified Cursor model identity One published row per Cursor base with thinking/fast/1M as dimensions, a Codex Fast toggle that reaches Cursor's fast variant, and a global switch that exposes -fast identities to clients without a toggle. Docs-only work-phase (wp1) of a four-phase unit. Contains 000_plan (work-phase map + measured current state + RUN verifier table), 001_current_state (why the picker never reads CURSOR_CAPABILITIES, where Codex Fast dies for Cursor), 002_audit_round1 (10 blockers from two review lanes, all folded), and diff-level decade docs 010/020/030 for the three implementation phases. Notable audit findings folded before any code: provider-level supportsServiceTier short-circuits before the per-model map; tierLogForRunTurn runs BEFORE runTurn so telemetry must recompute the variant rather than rebuild a non-pure request; usage/log.ts and usage/cost.ts read wireKind by string comparison and are invisible to tsc. Refs devlog/_plan/260902_cursor_unified_identity * feat(cursor): derive the picker seed from the capability table and label every row CURSOR_STATIC_MODELS was a hand-maintained list that drifted from CURSOR_CAPABILITIES: cursorUmbrellaRows() existed but only tests called it, so collapsing a variant changed routing without changing what Codex listed. The seed now derives from that function plus two declared lists for ids with no capability record, so the two can no longer disagree. Cursor rows also showed raw slugs (cursor/kimi-k3) because routedDisplayName passes a routed slug through unchanged and nothing carried Cursor's labels into the provider config. ProviderRegistryEntry had no modelDisplayNames field at all; the consumer (configuredModelDisplayName) already existed. Wire it through providerConfigSeed and enrichProviderFromRegistry, the latter per-model so an existing install picks up labels without losing an operator rename. The row set is unchanged (54 ids, none added or dropped) - this is a refactor of where rows come from, plus labels and three corrected windows (gemini 1048576, gpt-5.5-extra 200000) where the capability table was approximating the seed. Fixes the frozen row-count assertion that went red when claude-fable-5-1 was seeded in 5fc7d07: it now derives the expected count instead of hard-coding it. Refs devlog/_plan/260902_cursor_unified_identity/010_wp2_umbrella_seed.md * docs(cursor): park wp2/wp4 residuals in a numbered doc The roadmap named residuals in prose with no home (audit B14): effort ladders on a listed fast id, claude-4-sonnet-1m staying a real row, fastMode carrying two meanings, and the five pre-existing test failures that reproduce on a clean stash of this branch. Each records what would change the decision, so a later cycle does not rediscover them as new findings. Refs devlog/_plan/260902_cursor_unified_identity/040_residuals.md * docs(cursor): record the measured -fast round-trip that proves audit B11 The reviewer's claim that a bare -fast suffix picks the wrong dimension was not theoretical. Measured: claude-opus-5-fast resolves to claude-opus-5-high-fast (clamped, and in the quarantined regular family) while the Codex toggle would send claude-opus-5-thinking-max-fast. The mirror case is just as wrong -grok-4.6-thinking-fast degrades to a bare grok-4.6 with no effort and no fast marker, because grok has no thinkingFast spec. Either fixed suffix is wrong for half the table, which is why cursorFastIdFor composes from the base's defaultVariant. --------- Co-authored-by: jun <[email protected]>
1 parent 2cb5921 commit 7aa64bb

13 files changed

Lines changed: 1651 additions & 101 deletions
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Cursor unified model identity
2+
3+
One published row per Cursor base. Thinking, fast, and 1M are dimensions of that row,
4+
never extra slugs. The Codex Fast toggle drives the fast dimension; a global switch
5+
exposes `-fast` identities to clients that have no toggle.
6+
7+
## Why
8+
9+
Cursor's own picker already works this way: `Claude Opus 5` is one row whose submenu
10+
carries Thinking, Fast, Context (300K/1M), and Effort. OpenCodex has the same shape in
11+
`CURSOR_CAPABILITIES` but never publishes it — `cursorUmbrellaRows()` is called by tests
12+
only, and the picker is fed by the leftover product seed in `discovery.ts`.
13+
14+
## Constraints
15+
16+
- Every legacy id stays routable. Picker rows shrink; routability does not.
17+
- Never run the repo-wide suite locally. Focused `bun test` files + `bun run typecheck`
18+
+ `bun run privacy:scan`; exact-head GitHub CI is the authoritative gate.
19+
- Stacked PR chain against `dev`, parent first. Pushes use `git push --no-verify`.
20+
- Out of scope: Codex app UI, Cursor transport/native-exec, other providers' fast wires,
21+
dashboard `/api/models` namespaced ids, Desktop 3P hashed aliases.
22+
23+
## Work-phase map (dependency-ordered)
24+
25+
| WP | Deliverable | Consumes |
26+
|----|-------------|----------|
27+
| wp1 | this roadmap (docs only) | — |
28+
| wp2 / PR1 | seed derives from the capability table; display names; window alignment | wp1 |
29+
| wp3 / PR2 | `cursor-variant` FastWire; Codex Fast toggle reaches the fast dimension | wp2 (needs a stable base row set) |
30+
| wp4 / PR3 | `fastMode` lists `-fast` identities outside Codex; request-time promotion | wp3 (needs the resolver's fast upgrade) |
31+
32+
wp3 depends on wp2 because the Fast toggle is stamped per row: the row set must be the
33+
capability-derived one before a per-base capability map can be attached to it. wp4 depends
34+
on wp3 because listing `<id>-fast` is only honest once the request path actually honours it.
35+
36+
## Measured current state (2026-09-02, `.tmp/cursor_diff_probe.ts`)
37+
38+
```
39+
SEED_COUNT 54 # CURSOR_STATIC_MODELS
40+
CAPS_COUNT 34 # CURSOR_CAPABILITIES
41+
UMBRELLA_ROWS 34 # cursorUmbrellaRows() — none missing from the seed
42+
ROWS_NOT_IN_SEED [] # capability rows are all seeded
43+
CAPS_NOT_IN_SEED []
44+
SEED_NOT_IN_CAPS (16) # claude-4-sonnet-1m, claude-4.5-haiku, composer-1, composer-2.5,
45+
# composer-2.5-fast, gemini-2.5-flash, gemini-3-flash, gemini-3-pro,
46+
# gemini-3-pro-image-preview, gemini-3.1-pro, gemini-3.5-flash,
47+
# gpt-5-codex, gpt-5-fast, gpt-5-mini, gpt-5.1-codex, kimi-k2.7-code
48+
WINDOW_MISMATCH # gemini-3.6-flash 1048576/1000000, gemini-3.7-flash 1048576/1000000,
49+
# gpt-5.5-extra 200000/272000
50+
FAST_CAPABLE_BASES # claude-opus-4-7, claude-opus-4-8, claude-opus-5, grok-4.5, grok-4.6
51+
```
52+
53+
54 = 4 routers + 34 capability bases + 16 non-capability product ids.
54+
55+
## Verifiers (RUN 2026-09-02 before being written here, PLAN-VERIFIER-REAL-01)
56+
57+
| Command | Exit | Reads the change target? |
58+
|---|---|---|
59+
| `bun test tests/cursor-umbrella-rows.test.ts tests/cursor-catalog.test.ts tests/cursor-static-catalog.test.ts` | **1 — 74 pass / 1 fail** | yes — imports `catalog.ts` + `discovery.ts` directly |
60+
| `bun test tests/fastwire-policy.test.ts tests/fastwire-observability.test.ts tests/service-tier-capability.test.ts` | 0 — 303 pass | yes — imports `fastwire.ts` / `service-tier.ts` |
61+
| `bun test tests/claude-model-info.test.ts tests/claude-models-discovery.test.ts` | 0 — 27 pass | yes — imports `claude/model-info.ts` |
62+
| `bun run typecheck` | pending measurement at wp2 B | yes — `tsc --noEmit` over `src/` and `tests/` |
63+
| `bun run privacy:scan` | pending measurement at wp2 B | repo-wide credential scan; **does not observe this unit's behavior** |
64+
65+
`privacy:scan` is a required gate, not a verifier of identity behavior; that acceptance row
66+
is human review plus the focused tests above.
67+
68+
**Pre-existing red on this branch point.** The cursor suite fails at HEAD `d975feaa4`,
69+
before any change in this unit:
70+
71+
```
72+
(fail) row count shrank from the 69-row legacy seed
73+
tests/cursor-umbrella-rows.test.ts:40 Expected: 51 Received: 54
74+
```
75+
76+
Commit `5fc7d073e` seeded three `claude-fable-5-1` spellings and did not update the
77+
assertion. wp2 owns the fix (010 §4 rewrites that assertion to the derived composition),
78+
so wp2's C-phase evidence must show this file green rather than inheriting the failure.
79+
80+
Environment note: a fresh worktree needs `bun install` first — without it these files fail
81+
with `Cannot find module 'zod/v4'` / `'@bufbuild/protobuf'`, which is not a code defect.
82+
83+
## Terminal outcomes
84+
85+
DONE = wp1-wp4 closed through D with three stacked PRs at exact-head green CI.
86+
BLOCKED = CI infrastructure or a live Cursor roster change with evidence.
87+
NEEDS_HUMAN = a user-visible identity fork beyond the stated intent.
88+
BUDGET_EXHAUSTED = 6h wall-clock or three failed repair rounds on one WP.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Current state: how a Cursor row is built and where Fast dies
2+
3+
Research only. No diffs here.
4+
5+
## 1. The picker path never reads the capability table
6+
7+
`cursorUmbrellaRows()` (`src/adapters/cursor/catalog.ts:554`) is imported by
8+
`tests/cursor-umbrella-rows.test.ts` and nothing else in `src/`. The published rows come
9+
from a different list:
10+
11+
```
12+
CURSOR_STATIC_MODELS (discovery.ts:276)
13+
-> registry.ts:1110 models: cursorModelIds(CURSOR_STATIC_MODELS)
14+
-> derive.ts:230 seeded into config.providers.cursor.models
15+
-> provider-fetch.ts:1394 cursor branch: live GetUsableModels intersection
16+
-> sync.ts disabledModels removal, deriveEntry writes slug/display_name/...
17+
```
18+
19+
So the capability table describes dimensions the picker never sees. Collapsing a variant in
20+
`catalog.ts` changes routing, not listing.
21+
22+
## 2. Four inconsistencies, measured
23+
24+
**Mixed row semantics.** 16 seed ids have no capability record. Some are genuine products
25+
with no base (`composer-1`, `composer-2.5`, `gemini-3-pro`, `gpt-5-codex`), and three are
26+
dimensions wearing a row costume: `claude-4-sonnet-1m` (a real wire id, guarded by
27+
`REAL_1M_WIRE_IDS` at `catalog.ts:333`), `gpt-5-fast`, `composer-2.5-fast`.
28+
29+
**1M means two things.** `kimi-k3-1m` is synthetic — `CURSOR_ULTRA_1M_MODEL_IDS`
30+
(`discovery.ts:174`) folds it into `kimi-k3` + Max Mode. `claude-4-sonnet-1m` is a real
31+
upstream id and stays a second row. Both read as "1M" to a user.
32+
33+
**Fast means two things.** Opus/Grok fast ids were folded to aliases
34+
(`tests/cursor-umbrella-rows.test.ts:20-31`); `gpt-5-fast` and `composer-2.5-fast` remain
35+
rows because they have no capability base.
36+
37+
**Labels and windows.** `routedDisplayName()` (`sync.ts:272`) returns the slug unchanged for
38+
every provider except command-code, so Cursor rows read `cursor/kimi-k3`. Three windows
39+
disagree between seed and capability table (000_plan.md).
40+
41+
`ProviderRegistryEntry` has `modelContextWindows`, `modelInputModalities`,
42+
`modelReasoningEfforts` — but **no `modelDisplayNames`** (`registry.ts:265-290`), and
43+
`ProviderConfigSeed` (`registry.ts:327`) does not list it either. The consumer exists
44+
(`configuredModelDisplayName`, `provider-fetch.ts:634`) and reads
45+
`prov.modelDisplayNames`; only the registry->config path is missing.
46+
47+
## 3. Where Codex Fast dies for Cursor
48+
49+
Codex Fast is OpenAI `service_tier`, not a boolean:
50+
51+
```
52+
app catalog row service_tiers:[{id:"priority",name:"Fast"}] (effort.ts:160)
53+
-> request service_tier:"priority" (parser.ts:826)
54+
-> decideTier(policy, config.fastMode, callerTier) (fastwire.ts:392)
55+
-> applyServiceTierGate deletes the field when kind==="drop" (responses/core.ts:2638)
56+
```
57+
58+
The drop is structural. `FAST_WIRE_ADAPTERS` (`fastwire.ts:14-18`) maps
59+
`"service-tier" -> {openai-chat, openai-responses}` and `"anthropic-speed" -> {}`. Cursor is
60+
in neither, so `resolveFastPolicy` sets `eligibility: "wire-unavailable"`,
61+
`serviceTierSupportFromPolicy` publishes `supportsServiceTier: false`, and
62+
`applyCatalogModelMetadata` never stamps the tier. No config value fixes this: forcing
63+
`supportsServiceTier: true` still fails the wire check, and declaring
64+
`fastWire.kind: "service-tier"` fails the adapter-set check.
65+
66+
Meanwhile the fast wire genuinely exists, keyed off the picked id:
67+
68+
- Grok (`wirePrefix: "cursor-"`): base id + `{id:"effort"},{id:"fast",value:"true"}`
69+
parameters, via `cursorGrokFastSelection` (`catalog.ts:538`,
70+
`request-builder.ts:204-213`).
71+
- Everyone else: flattened wire id `claude-opus-5-thinking-high-fast` via `composeWireId`
72+
(`catalog.ts:446-466`).
73+
74+
`normalizeCursorModelId` (`request-builder.ts:189`) receives only `parsed.modelId` and
75+
`parsed.options.reasoning`. `rg` finds no `serviceTier`/`tierDecision` read anywhere under
76+
`src/adapters/cursor/`.
77+
78+
Telemetry is a separate hole: `adapters/registry.ts:156-176` attaches
79+
`createAdapterTierMetadata(..., null, null)` for every non-OpenAI adapter, so even a
80+
working Cursor fast request would report an absent wire field.
81+
82+
Five bases have a fast dimension: `claude-opus-4-7`, `claude-opus-4-8`, `claude-opus-5`,
83+
`grok-4.5`, `grok-4.6`. Stamping a tier on the other 29 would recreate the dead-toggle
84+
defect `NO_FAST_TIER_NATIVE_SLUGS` (`parsing.ts:297`) exists to prevent.
85+
86+
## 4. Listing surfaces outside Codex
87+
88+
`GET /v1/models` has three branches (`server/index.ts:1316-1560`):
89+
90+
| Trigger | Id shape | Composed at |
91+
|---|---|---|
92+
| `?client_version` | catalog slugs | `buildCatalogEntries` |
93+
| `anthropic-version` / `?flavor=anthropic` | `claude-ocx-*` or Desktop hashes | `claude/model-info.ts:105` |
94+
| default | `alias ?? provider/id` | `server/index.ts:1534` |
95+
96+
`buildAnthropicModelInfos` already publishes a second row for a dimension: `push1mVariant`
97+
(`model-info.ts:115-128`) appends `<id>[1m]`, and `resolveInboundModel` strips it before
98+
routing. That is the precedent `-fast` listing should follow.
99+
100+
`config.fastMode` (`types/config.ts:462`) is tri-state and today only reaches
101+
`decideTier` plus Codex's injected `[features] fast_mode` (`codex/inject.ts:708`). It
102+
touches no listing code: `rg fastMode` is empty in `server/index.ts`,
103+
`claude/model-info.ts`, `management/model-rows.ts`, and `cli/models.ts`.
104+
105+
Dashboard `/api/models` uses `namespaced` as the disable/export key
106+
(`catalogModelSlug`, `parsing.ts:703`), so rewriting it would desync `disabledModels`.
107+
That surface stays untouched.

0 commit comments

Comments
 (0)