Repository navigation
refactor(models): simplify picker and thinking projections - #130694
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 2:25 AM ET / 06:25 UTC. ClawSweeper reviewWhat this changesThe PR simplifies model picker and Gateway thinking projections, and makes bundled Crabbox and Codex Doctor registrars query the core registry they write to. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open. No actionable patch defect was found; the repair is not on current main, and the protected maintainer-owned PR remains assigned while exact-head checks are incomplete. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherControl UI derives model controls from Gateway sessions and the model catalog, while Gateway projects thinking choices for session responses. Doctor loads plugin-owned diagnostics through the core health registry and returns findings to the CLI. flowchart LR
A[Gateway sessions and model catalog] --> B[Control UI model controls]
A --> C[Gateway thinking projection]
D[Bundled plugin registrar] --> E[Core health registry]
E --> F[Doctor lint command]
B --> G[Operator model selection]
C --> G
F --> H[Diagnostic findings]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -86, Tests +47. Total -39 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the single host-registry path and merge only after exact-head checks are green and the Codex native-version contract is confirmed from upstream source. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main reads through an artifact-local registry and writes through the core host registry, so a repeated same-process Doctor registration can hit the duplicate-ID rejection path. Is this the best way to solve the issue? Yes for the owned repair: passing the core host lookup alongside registration restores one registry authority without adding a new config, persistence, or plugin SDK contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3aef4d546c70. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review The consumer refactor remains unchanged. CI investigation exposed an existing split-registry bug in the Crabbox Doctor path and its Codex sibling; the added commit carries the host lookup alongside registration, following memory-core. Both regressions were demonstrated before repair, and the expanded plugin/host tests pass. The PR description records the original CI timeout, remaining local whole-file timing retry, independent review, provenance, and the unchanged persistence boundary. Exact-head CI and final built-CLI proof remain required before landing. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged via squash.
|
…130694) * refactor(models): simplify picker and thinking projections * fix(doctor): keep bundled checks in the host health registry * test(doctor): consolidate repeated lint invocation * docs: keep Doctor release context in the PR body
What Problem This Solves
The chat model picker, tool-model selection, and Gateway thinking metadata repeat the same normalization/projection work in several branches. This maintainer-requested cleanup removes those parallel paths while preserving the models, labels, defaults, and controls operators see.
While diagnosing this PR's Doctor CI timeout, repeated lint execution exposed an existing registry-ownership bug in Crabbox, also reproduced in Codex: the plugin looked up a check through its own SDK module graph but registered it into the host's registry. With separate artifact-loader graphs, the second invocation registered the same ID again and threw instead of returning diagnostics.
Why This Change Was Made
Keep each decision with its existing owner: the UI prepares one retained catalog for picker options and label disambiguation; model references normalize directly from their stored strings; Gateway thinking metadata has one projection with optional request-local caching. Fast-mode provider matching scans the catalog once, retaining qualified-route precedence and refusing stale-provider fallback for ambiguous catalog matches.
Removed the transient override union/constructor, a caller-dominated server-ref fallback, repeated picker availability scans, and duplicate cached/uncached thinking projection. No new abstraction or dependency, public/config/default surface, persistence change, or provider catalog metadata change.
The Doctor repair passes lookup alongside registration through both bundled plugin artifacts, following the existing memory-core contract. It removes the runtime health-barrel back-edge. CUA and Policy already deduplicate explicit hosts and also support a separate implicit-global registration contract; those paths are unchanged. Codex's remaining broad model/runtime SDK imports are a separate cold-loading follow-up, not needed to repair registry ownership.
Production LOC: +91/-177 (net -86). Tests: +92/-45 (net +47). The Doctor portion adds eight net production lines to carry the actual host registry across the plugin boundary; the consumer cleanup removes 94. No pure moves or generated files. Release-note context is in this body; the final documentation-only commit removes the root changelog entry to follow current main's release-owned policy.
User Impact
No intended change to model selection. Nested IDs, legacy saved route aliases, unavailable models, ambiguous providers, session pins versus inherited defaults, and request-owned tool selection keep their existing contracts. Repeated Doctor lint now uses the same host registry for lookup and registration. Probe behavior, check selection, config, and stored data are unchanged. The provider fast-mode allowlist remains unchanged: replacing it requires authoritative route/auth-bound capability metadata, which is a separate follow-up, not something to infer from effective session configuration.
Evidence
doctor --lint --json --only crabbox/cloud-worker-profilesreturns exactly one actionable missing-binary finding and exit 1; the Codex managed-app-server check accepts the installed pinned artifact and exits 0. Both built plugin APIs register once per independent host across repeated calls. No operator Gateway or private profile was used.@daytona/sdkdependency in the shared worktree install; no dependency reconciliation was performed. Exact-head hosted CI owns complete installed-dependency coverage.--max-old-space-size=8192budget passed. Runtime source is unchanged by the subsequent test-only loop commit.health check already registered: crabbox/cloud-worker-profiles; the Codex independent-host test registered twice instead of once. An additional built Codex artifact probe reproduced the duplicate registration. The unchanged whole Doctor lint file passed locally before adding the repeat-call regression; the CI timeout is not being described as a measured performance attribution.Provenance: Crabbox's mismatch came from #124995 (code author, PR author, and merger @steipete; August 18, 2026). Codex's matching pattern came from #124137 (code author Jason / PR author and merger @fuller-stack-dev; August 16, 2026). This PR repairs the host boundary without changing the existing version probe. Direct upstream source inspection checked
codex-rs/cli/src/main.rs:98-113atd47e5cc0e2bbd35774dff15c83570519735d2ac4, where the CLI enables Clap's version option.ClawSweeper follow-through: the latest review at 06:25 UTC on the final head found no actionable patch defects. Its remaining rank-up requests are complete: exact-head CI passed on
995fc460b6797e0fb84d267025a586752a54cef0, and the lead personally inspected the unchanged upstream Codex version contract in codex-rs/cli/src/main.rs. The review worker lacked that sibling checkout; the maintainer verification did not. The CI guard initially hit a 120-second Git fetch timeout; its targeted unchanged retry passed. The built command owner also passes twice in the same process for each affected check: Crabbox returns exit 1 / one finding / one check on both calls; Codex returns exit 0 / zero findings / one check on both calls. Separate real CLI parser runs pass. The stored-data detector is not applicable: there is no schema, serialized field, or persistence behavior change. Independent Codex autoreviews of the consumer cleanup, complete Doctor repair, final test-loop cleanup, and documentation-only changelog removal are clean.Focused command:
Best-fix judgment: consolidate the existing owners, rather than introduce a cross-layer model registry or duplicate provider policy in the UI. Core runtime selection, plugin metadata, auth boundaries, and persisted values are unchanged. Code inspection covered the complete production owners and their chat/session/Agents callers, Gateway row construction and thinking handlers, adjacent tests, and model metadata stores. No authenticated provider inference is claimed for this behavior-neutral consumer refactor.