3.0 KiB
3.0 KiB
id: task-06-profile-editor title: Profile editor: gone start model red + fallback row + toggle status: done wave: 3 depends_on: [task-01-profile-fields, task-05-picker-gone-support] plan: docs/plans/no-silent-model-fallback/plan.md spec: docs/specs/agents/requirements/no-silent-model-fallback.md
Task 6 — Profile editor rows
Change
apps/web/components/settings/profile-form-fields.tsx (CapabilitiesRow /
ModelPicker):
- Start model: when
profile.modelis non-empty and absent from the current model list, keep it as the current value, render the trigger/row red (text-destructive) and the option disabled with reason ("no longer available — select a new model"). The user can still change it (the picker opens and valid models are selectable), but cannot re-select the gone one. - Agent fallback row (new, directly under Start model): optional select
over the same model list bound to
profile.fallback_model, label "Agent fallback" + helper ("if the start model becomes unavailable, automatically switch to"). Same gone-red/disabled treatment when the fallback model itself is gone. Hidden whenauto_fallbackis ON. - "Fallback automatically to next model" toggle (new row): switch bound
to
profile.auto_fallbackwith helper text. When ON, the fallback-model row is hidden (per spec precedence). - Parity:
apps/web/components/agent/cli-profile-editor.tsx(ModelModeFields) gets the same two rows. - The profile form state type (
ProfileFormData) gainsfallbackModel/autoFallback; dirty-tracking (profileModelIsDirty-style helpers) for the new fields; save payload flows throughtoAgentProfilePayload.
i18n: ALL new copy via t() into apps/web/src/locales/{en,pseudo}/settings.json
(camelCase keys): startModelUnavailable, agentFallback, agentFallbackHelper,
autoFallback, autoFallbackHelper, fallbackModelUnavailable. The file
profile-form-fields.tsx is unmigrated — added lines are judged by the
ratchet, so no hardcoded literals on new/edited lines.
Acceptance
- Unit test: gone start model renders the red treatment + disabled option; current value preserved.
- Unit test: fallback row appears when
auto_fallbackis off; hidden when on; toggle hides/shows it. - Unit test: gone fallback model renders red + disabled.
- Unit test: save payload includes
fallback_model/auto_fallback; dirty detection works for both. - i18n ratchet passes on the edited files.
Verification
cd apps/web && pnpm vitest run components/settings/profile-form-fields.test.tsx
cd apps/web && pnpm run typecheck
cd apps/web && pnpm run i18n:ratchet
Risks
- The editor has two surfaces (
profile-form-fields.tsxandcli-profile-editor.tsx) — keep both consistent. - The empty-model case ("profile model means use the agent's default") must stay untouched: gone-treatment applies only to non-empty models.
- Do not disturb the
data-settings-dirtycontainer semantics used by the settings save indicator.