fix(provider): accept "active" model status in config and catalog schemas - #1135
Conversation
…emas The runtime already emits and reads status "active" (provider.ts default `model.status ?? "active"`), but the config-load schema and the models.dev catalog schema only allowed "alpha" | "beta" | "deprecated". A user config or catalog entry declaring status: "active" was rejected during config load, throwing InvalidError instead of loading. Add "active" to the status literal set in all three schemas: the config Model (config/provider.ts) and both the models.dev Model and PublishModel (provider/models.ts). Strictly widens the accepted set, so no previously valid input is rejected. Adapted from upstream anomalyco/opencode 00c3248295 (PR #26592, thanks Kit Langton). dev and upstream/dev share no common ancestor; reimplemented, not cherry-picked (PawWork uses zod for the catalog schema where upstream uses Effect Schema). Test: added regression asserting both the config Model schema and the models.dev Model schema accept status: "active", proven red->green.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds the 'active' status to the model schemas in both the config provider and models.dev definitions, preventing crashes when a model declares this status. It also introduces corresponding unit tests to verify that both schemas successfully parse the 'active' status. There are no review comments, so no additional feedback is provided.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Restructure the right-side Status panel from 2 sections (Progress + Sources) into 4 (Progress -> Workspace/Git -> Changed files/Artifact -> Sources), fold the standalone Files tab into the panel as a compact changed-files list, and move the titlebar worktree badge into the Git section. Change boundary (packages/app, packages/ui): - Status panel: new Git section (diff stats -> Review, branch row, worktree indicator with tooltip + open-directory) and Artifact section (changed files with hover/focus-visible open + reveal); Git section hidden outside a git repo. Data from sync.data.vcs (branch), sessionInfo().executionContext.activeWorktree (worktree), aggregateFiles(turn_change_aggregate) (diff stats). - Files tab removed from RightPanelStaticTab / RIGHT_PANEL_TAB_META / command palette / keybind; legacy persisted "files" coerced to "status" via coerceLegacySidePanelTab + migrateLegacyRightPanelTab. - Titlebar PawworkWorktreeBadge removed (worktree info now lives in the panel Git section). - New `changes` icon registered (packages/ui). Verification: - typecheck clean; full app unit suite 1753 pass / 0 fail. - Visual: status-summary-panel snap (4 sections + rest->hover open/reveal) plus a dev:desktop walk in the real Electron host (dark theme, zh locale, live sidecar) - Git section populated from real VCS (+N/-N, branch main), Artifact section listing a real session file (sample-test.md, +76). - Codex adversarial review P1 findings fixed; 5 review threads resolved. Brought current with dev: one conflict in context/layout.tsx - dev had extracted the inline layout helpers into context/layout-state.ts / layout-projects.ts (#1056 slice work). Took dev's refactored layout.tsx and ported this branch's defaultSidePanelTab `| "files"` widening into layout-state.ts. Final state 0 behind dev; also merged #1135/#1136/#1137/#1139 cleanly (no file overlap). Deferred: dev:desktop worktree-indicator tooltip + non-git-hide are state-conditional and were not exercised live (hover open/reveal covered by the snap). session-side-panel.test.tsx isolation failure is the pre-existing mock.module warmup flake (its @/context/command mock omits matchKeybind/parseKeybind that terminal.tsx imports transitively); green in the full suite, tracked under the #1084 mock.module cleanup. Relates #1056.
Summary
A user config or models.dev catalog entry declaring
status: "active"crashed config load. The runtime already emits and reads"active"(provider.ts defaultmodel.status ?? "active"at :1041 and :1267), but the config-load schema and the catalog schema only allowed"alpha" | "beta" | "deprecated". So a model withstatus: "active"was rejected during validation —ConfigParse.schemathrowsInvalidErroron a failedsafeParse— instead of loading.Fix
Add
"active"to the status literal set in all three schemas:config/provider.ts:54— the configModel(Effect SchemaSchema.Literals), used to validateopencode.json.provider/models.ts:97— the models.devModel(zodz.enum).provider/models.ts:163— the models.devPublishModel(zodz.enum).Strictly widens the accepted set, so no previously valid input is rejected.
PawWork gap vs upstream
Adapted from upstream
anomalyco/opencode00c3248295(PR #26592 — thanks Kit Langton). Upstream widens two Effect-Schema literal sets; PawWork's catalog schema (provider/models.ts) uses zod, so the port adds"active"to the zodz.enumthere and to the Effect-SchemaLiteralsinconfig/provider.ts.devandupstream/devshare no common ancestor; re-implementation, not a cherry-pick.Test
Added
model-status-active.test.ts: asserts both the configModelschema (via its derived.zod, the actual config-load validator) and the models.devModelschema acceptstatus: "active". Proven red → green (without the widen bothsafeParsecalls returnsuccess: false).Verification
bun test test/provider/model-status-active.test.ts— 2 pass (red→green confirmed)bun test test/provider/models-refresh.test.ts test/config/provider.test.ts— 14 pass (no regression)bun run typecheck— clean