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
At the F3 head of the stack, resetState (reset / new task) and the settings import invalidate only the calling instance's per-view state. Sibling tabs holding live ClineProvider instances keep stale view-local state — mode, currentApiConfigName, provider profile — after a reset or settings import performed from another tab, so stale per-view entries remain in the global viewStates and keep driving stale mode/profile presentation in those tabs.
vps2 F4 of the durable per-view state series (fork tracking issue easonLiangWorldedtech#41). Draft PR: #1562 (branch vps2/f4-cross-instance-reset, stacked on the F3 head 8da5c6e; head 80c147f) — #1562
Fix scope (5 files, 342 insertions / 1 deletion = a+d 343 measured vs the F3 head)
src/core/webview/ClineProvider.ts — the broadcastResetToAllInstances() method (per-instance _clearViewLocalState + one global contextProxy.setValue("viewStates", undefined) write — the single write-queue clear — + sibling postStateToWebview) and its wiring into resetState before the final postStateToWebview().
src/core/config/importExport.ts — ImportWithProviderOptions gains the optional broadcastResetToAllInstances(): Promise; importSettingsWithFeedback calls it in a guarded try/catch after the settingsImportedAt write (a broadcast failure never fails the import; console.warn on failure).
src/core/config/tests/importExport.spec.ts — 3 new tests: broadcast on successful import; skip when the callback is missing (with a console.warn negative assertion that pins the guarded call); import result kept successful when the broadcast throws.
src/core/webview/tests/ClineProvider.parallelMode.spec.ts — the multi-instance + _clearViewLocalState describes appended from the CS copy (116 lines: CS L1674-L1789 — the blank separator + the two describes — byte-identical; 5 new tests).
src/core/webview/tests/ClineProvider.spec.ts — (a) the forward fix of the F3 resetState sentinel: F4's single global viewStates clear removes the key (real VS Code Memento semantics: update(key, undefined) deletes the key), so the F3-era toEqual({}) expectation becomes toBeUndefined() — the test intent (no persisted per-view entry after reset) is preserved and satisfied more strongly; (b) one new multi-instance test pinning broadcastResetToAllInstances (a sibling's view-local state is cleared by another instance's resetState; each instance receives exactly one state post — the caller only its final post): gate-required, the fix(webview): invalidate per-view state after reset and import #981/CS port alone left 5 surviving mutants on the broadcast path.
Series note
Draft PR; this unit is the 6th of the merge chain (F1a to F1b to F1c to F2 to F3 to F4 to F5 to F6 to F7). The PR body documents the CS not-ported register, the port-fidelity verification, the budget measurement, and the mutation-diff gate. No Closes/Fixes/Resolves linkage — this issue is the series gap record for the unit.
Gap
At the F3 head of the stack, resetState (reset / new task) and the settings import invalidate only the calling instance's per-view state. Sibling tabs holding live ClineProvider instances keep stale view-local state — mode, currentApiConfigName, provider profile — after a reset or settings import performed from another tab, so stale per-view entries remain in the global viewStates and keep driving stale mode/profile presentation in those tabs.
Upstream provenance
Fix unit
vps2 F4 of the durable per-view state series (fork tracking issue easonLiangWorldedtech#41). Draft PR: #1562 (branch vps2/f4-cross-instance-reset, stacked on the F3 head 8da5c6e; head 80c147f) — #1562
Fix scope (5 files, 342 insertions / 1 deletion = a+d 343 measured vs the F3 head)
Series note
Draft PR; this unit is the 6th of the merge chain (F1a to F1b to F1c to F2 to F3 to F4 to F5 to F6 to F7). The PR body documents the CS not-ported register, the port-fidelity verification, the budget measurement, and the mutation-diff gate. No Closes/Fixes/Resolves linkage — this issue is the series gap record for the unit.