You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(shared,web,terraform): address CodeRabbit feedback on #672
Must-fix:
- model-defaults.ts: per-field fallback chain (2.1) — defaultModel and
defaultPlanModel now resolve independently as `DB > env > shared
constant`. The previous all-or-nothing gate required BOTH fields in
the CP response; when only one was present, both fields fell back
together to env/constants, discarding the partial DB value.
Should-fix:
- models-settings.tsx: setDirty only fires on an actual state change
(2.2). Previously toggling a model off would set dirty even when the
toggle was blocked by the default-model guard, enabling Save on a
no-op. The fix tracks a `changed` flag inside the updater and only
calls setDirty when the underlying Set actually mutated.
- models-settings.tsx: SWR data sync moved from render phase into
useEffect (2.3). The previous in-render setState would surface a
React warning under StrictMode and risked an unnecessary re-render.
- terraform/environments/production/workers-{linear,slack}.tf:
align DEFAULT_PLAN_MODEL to "anthropic/claude-opus-4-6" (2.4) to
match the format used by workers-control-plane.tf and
workers-github.tf. The bare "claude-opus-4-6" string was not a
fully-qualified model ID and would be rejected by isValidModel.
Targeted regression test:
- model-defaults.test.ts: two new cases verifying that when the CP
response contains only defaultModel (resp. defaultPlanModel), the
other field independently falls back to env without the present
field being discarded.
Verification: npm run build -w @open-inspect/shared && npm run lint &&
npm run typecheck && npm test (shared 16/16, control-plane 66/66,
web 32/32 — all green).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments