Repository navigation
fix(webview): invalidate live sibling view state on reset and settings import (vps2 F4) - #1562
Open
easonLiangWorldedtech wants to merge 288 commits into
Open
easonLiangWorldedtech wants to merge 288 commits into
easonLiangWorldedtech wants to merge 288 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft PR — vps2 unit F4 (cross-instance reset and import invalidation). Each view's per-view state follows the profile that view actually uses.
Rewritten 2026-11-20 against head
0c8383486aeb; the body it replaced is verbatim in the lane filepr1562-scratch/r13-chronicle.md.Related GitHub Issue
Closes: #1561 - by content, not by label: it records the per-view state bug this unit fixes. #2488 stays open with the write-ownership decision this unit does not settle.
Description
A view holds the profile it uses and the state that belongs to it. Every path that moves a profile must move the state with it.
src/core/webview/ClineProvider.ts- owner of per-view state. A reset callsbroadcastResetToAllInstancesafter the shared reset lands, and again when it fails after already writing; every live view clears its own state, durable entries included. A save refreshes pinned views, a deletion re-pins the views that named the deleted profile, a rename re-points them, and a view in teardown stays out of the fan-outs.src/core/config/ContextProxy.ts- durable store for the per-view records.src/core/config/ProviderSettingsManager.ts,src/core/config/importExport.ts- profile lookup, and the import that calls the same broadcast.src/core/webview/webviewMessageHandler.ts- messages that switch mode or profile, rename a profile, or start an import.src/extension/api.ts- API facade: events and calls that carry the view id and profile name; the rollback log names keys, not credential values.src/core/task/Task.ts,src/core/tools/SwitchModeTool.ts- switches from inside a task; a failed switch keeps the old mode and still delivers the message.src/activate/registerCommands.ts- command wiring for a second extension instance.webview-ui/src/utils/vscode.ts,webview-ui/src/context/ExtensionStateContext.tsx- webview state wrapper and cache; a read that throws after every write landed returns the in-memory state.packages/types/src/global-settings.ts,packages/types/src/vscode.ts,packages/types/src/vscode-extension-host.ts- the setting, its validation, and the state posted to the webview.ClineProvider.spec.tsandapi-configuration.spec.ts.src/eslint-suppressions.json,src/package.json,.gitignore- tooling lines.Budget, read from the server on 2026-11-20: 36 files, +23,573 and -1,702 against main
5ba06451e0f2; 19 files are tests (+19,127, -1,215), 17 are production or tooling (+4,446, -487). Residual unchanged: a failed live-pair check leaves the durable half; finding D-1 decides which side wins.How to test
node node_modules/vitest/vitest.mjs run core/webview/__tests__/ClineProvider.spec.tsinsrc/.node node_modules/vitest/vitest.mjs runinsrc/.node node_modules/vitest/vitest.mjs runinwebview-ui/.tsc --noEmit -p .insrc/andwebview-ui/;tsc --noEmit -p tsconfig.esm.jsoninapps/vscode-e2e/.eslint <file> --max-warnings=0 --no-warn-ignored, theneslint --prune-suppressions --max-warnings=0on the touched files; restoresrc/eslint-suppressions.json.prettier --checkon the touched files.Commands run from the package directory; run numbers live in the lane record.
State and blocker
0c8383486aeb; comment 7051452544 names them.Mutation gate failed: extension has 2631 changed executable lines (limit 500).Not required for merge; needs a human choice - split, or a narrow exclusion.5ba06451e0f2is the head's second parent.mergeable_state: blockedis the review gate, not a merge conflict.Pre-Submission Checklist
Visual Snapshots, Videos, Documentation
None: no rendered, interaction, or documentation change. Comment on this pull request, or reach easonLiangWorldedtech.