Skip to content

Commit 8f6749a

Browse files
fix: rebuild re-pinned siblings' tasks on profile deletion
Review-round fix on the shared code this unit carries: rePinViewLocalStateForDeletedProfile updated each sibling's buffer but not its running task: the posted state prefers the task's own apiConfiguration, so a conversation in a view pinned to the deleted profile kept sending the deleted profile's settings - the re-pin now rebuilds the sibling's API handler with the replacement's settings and re-points the task's sticky profile name, mirroring the activation path. Tested by the sibling re-pin assertions in the unit that owns the parallel mode suite; this unit's suites confirm the port is behavior-preserving for its own coverage. Proofs: ClineProvider.spec and sticky-mode green; eslint --max-warnings=0 clean; prettier clean.
1 parent 7b9f12b commit 8f6749a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/core/webview/ClineProvider.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,6 +2708,16 @@ export class ClineProvider
27082708

27092709
// Direct private access: compile-time safe across sibling instances.
27102710
await instance._saveViewLocalStateFromMutation(values)
2711+
// The active task of a view pinned to the deleted profile holds its own API
2712+
// handler and sticky profile name built from the deleted profile: rebuild
2713+
// the handler with the replacement's settings and re-point the sticky name,
2714+
// or the running conversation keeps sending the deleted profile's
2715+
// configuration even though the view's buffer was re-pointed (the posted
2716+
// state prefers the task's own apiConfiguration).
2717+
if (replacementSettings) {
2718+
instance.updateTaskApiHandlerIfNeeded(replacementSettings, { forceRebuild: true })
2719+
}
2720+
await instance.persistStickyProviderProfileToCurrentTask(replacementName)
27112721
await instance.postStateToWebview()
27122722
}),
27132723
)

0 commit comments

Comments
 (0)