fix(web-ui): scope task model picker changes per task#470
fix(web-ui): scope task model picker changes per task#470oshea-patrick wants to merge 3 commits into
Conversation
Greptile SummaryThis PR fixes two related bugs in the task-level model picker: a task overriding only
Confidence Score: 5/5Safe to merge — all changed paths are covered by dedicated tests and the logic correctly scopes model changes to the intended task. The three changed behaviours (provider-default model resolution, task-scoped persistence routing, and board-state override materialization) each have direct test coverage. The async catalog-loading race that previously caused a transient dirty state is resolved by comparing effective model IDs rather than raw state values, and the test with a deferred catalog promise explicitly verifies no intermediate dirty snapshot occurs. No pre-existing guards are weakened in ways that could affect unrelated code paths. No files require special attention.
|
| Filename | Overview |
|---|---|
| web-ui/src/hooks/use-runtime-settings-cline-controller.ts | Adds getInitialTaskModelId, getComparableModelId, and getResetModelId helpers; hasUnsavedChanges now compares effective model IDs to prevent transient dirty-state during async catalog load |
| web-ui/src/state/board-state.ts | applyTaskDetailClineSettingsChange no longer requires pre-existing explicit agent settings and now calls updateTask directly, correctly materializing task overrides for inherited tasks |
| web-ui/src/components/detail-panels/cline-agent-chat-panel.tsx | shouldPersistTaskClineSettings now includes the onTaskClineSettingsChanged !== undefined condition so detail-panel model changes always route to the task callback when one exists |
| web-ui/src/components/detail-panels/cline-agent-chat-panel.model-persistence.test.tsx | New test file covering task-callback routing vs workspace-save fallback for detail-panel model selection |
| web-ui/src/hooks/use-runtime-settings-cline-controller.test.tsx | Adds two tests: provider-default model resolution for task overrides with only providerId, and no transient hasUnsavedChanges flash during deferred catalog load |
| web-ui/src/hooks/use-task-sessions.test.tsx | Adds cross-task provider/model isolation test; refactors mock to be task-specific via mockImplementation |
| web-ui/src/state/board-state.test.ts | Adds tests for inherited-task materialization and cross-task isolation in board state mutations |
Reviews (2): Last reviewed commit: "fix(web-ui): keep task model picker chan..." | Re-trigger Greptile
Summary
Closes #469.
When task-level Cline settings partially override the workspace defaults, the task detail model picker can initialize or persist the wrong model. This PR fixes two related bugs:
Changes
getInitialTaskModelIdnow consults the provider catalog to resolve the correct default model when a task overridesproviderIdbut notmodelIdonTaskClineSettingsChangedpresence is sufficient)applyTaskDetailClineSettingsChangeno longer requires pre-existing explicit task settings to materialize a concrete overridehasUnsavedChangesnow compares effective model selections (resolving blanks to provider defaults) so async catalog loading does not transiently flip the settings UI into an unsaved stateTests Added
taskClineSettingshasproviderIdbut nomodelIdhasUnsavedChangesflash during async provider catalog loadingclineSettingsValidation