Repository navigation
test(webview): F2a - profile-mutation state semantics and the mode-rollback guard - #1919
Open
easonLiangWorldedtech wants to merge 181 commits into
Open
easonLiangWorldedtech wants to merge 181 commits into
easonLiangWorldedtech wants to merge 181 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.
Related GitHub Issue
This unit does not close an upstream issue: it is split unit F2a of the durable per-view state (vps2) series, whose split plan is issued and tracked on (issued before this PR opened). It supersedes the closed umbrella PR 1555, and merges in the chain order F1a 1546 → F1b 1550 → F1c 1552 → F2a → F2b → F2c 1921.
Related: #1992 —
Zoo-Code-Org/Zoo-Code#1992([Tracking] vps2 chain: rules, port sources, chain-level rows) is the upstream tracking issue for this chain and the home of this unit's split plan, unit boundaries, acceptance criteria and review dispositions. It is written asRelated:rather thanCloses:on purpose: merging one unit must not close the acceptance record that #1921 and the tail units still need. There is no other upstream issue for this unit, and no upstream number is invented here.Description
Content source of record:
kind: commit, base8554307ec→ headbff2a5ca8(PR 1555), replayed onto the currentmaintip so the branch carries nothingmainalready has.Budget (own delta, not the stacked view): 173 a+d standalone, 12 changed executable lines.
One gate scope: the state semantics of a profile mutation must hold for every live view, not only the view that performed it, and a mode rollback must not be able to persist a profile that no longer exists.
apiConfigurationof every other liveClineProviderpinned to that profile (refreshViewLocalStateForUpdatedProfile) and re-posts each affected view's state, so no view keeps serving — or running on — settings it buffered before the mutation.rePinViewLocalStateForDeletedProfile), replaces their configuration with the surviving profile's, and persists the replacement through the serialized write queue so their durableviewStatesentries survive a reload.deleteProviderProfilenow writes only the profile list back instead of replaying a full settings snapshot, so it cannot clobber unrelated keys (notablyviewStates) that concurrent views mutate directly.Also in this head (
1b9d6d73f), from review:deleteProviderProfileperforms two durable writes — the settings-store commit and the profile-list write. If the list write (or a later selection update) fails, the stored list still names a profile whose settings are gone and no later selection or load can recover them. The settings are now captured before the commit and written back throughsaveConfigwhen a later step fails, so the durable metadata and the store agree again (the deletion simply did not happen); the original error is rethrown and a failed compensation is logged with the residual risk stated.Reviewer focus: the compensation is deliberately a settings restore, not a list rollback — the list write is the step that failed, so the list keeps naming the profile and the store is made to agree with it. Restoring the original
idmatters: a new id would orphan the task history entries that reference the profile.Test Procedure
New/updated tests in
core/webview/__tests__/ClineProvider.spec.ts:getState(), and that its webview was re-posted.viewStatesentry.saveConfigis called with the original id and secret while the original error propagates.Each is verified as a pin, not a mirror of the implementation: the two cross-view tests fail when the helper bodies are made to return early, and the compensation test fails when the production change is stashed.
Environment: Windows 11 / Node 22,
vitestlanes run fromsrc/. Local result at this head:ClineProvider.spec.ts283 passed (280 baseline + 3 new);tsc --noEmitunchanged from this branch's local baseline; eslint clean on both touched files with unchanged suppression counts.Reviewer reproduction at head
68f4cf790(unit rebased ontovps2/f1b-getstate-merge@702a15d93)Suppression counts moved once and only downward:
core/webview/__tests__/ClineProvider.sticky-mode.spec.ts,@typescript-eslint/no-explicit-any26 → 25, because the removed cases took one suppressedanywith them. No suppression was added and no count increased; the rest ofsrc/eslint-suppressions.jsonis byte-identical to the fold base.Fold pin. This head is the unit rebased onto
vps2/f1b-getstate-merge@702a15d93. #1550 has since advanced (6a21695f5,db93970af,28cae0635,0c6f79b63,8ef71e68e, currentlye0cb48c51); this fold stays pinned to702a15d93and will be re-based onto the landing #1550 head rather than mix two generations of view-state machinery in one commit. Every red→green control named below is pinned to this tree.Owed refresh (deferred deliberately, not missed). The chain fixes that merge earlier than this unit will be re-carried on that refresh: #1557
8320d7803+eb553a40d, #1562ec2fb3724+f555d04a0, #222684a0d7644+db5bffa49. #2226'spostMessageToWebviewbecomingPromise<boolean>would force re-typing 27 call sites and re-verifying this unit's 1199 tests a second time, and the "test doubles silently disagree" risk it introduces only bites if #1919 merges before #2226, which the declared chain order forbids. The host-minted capability the Security Boundaries row asks for is #2226's claim token (claimTokeninpackages/types/src/global-settings.ts,viewStateClaiminpackages/types/src/vscode-extension-host.ts,pendingViewStateClaims/postViewStateClaimToWebviewinsrc/core/webview/ClineProvider.ts), so the adoption/binding step is scheduled on this unit after #2226 lands instead of being re-invented here.Hook note.
.husky/pre-pushexists on the branch, but this worktree's installed hook set (.husky/_, which is gitignored and produced bypnpm installrather than by the branch) had apre-commitwrapper and nopre-pushwrapper, sogit pushdid not executepnpm run check-types; nothing was skipped with--no-verify. The hook's own command was run directly for this head and its result is quoted above, and the missing wrapper has now been installed in the worktree for subsequent pushes.Pre-Submission Checklist
No documentation change: the user-facing flow (activate / edit / delete a provider profile) is unchanged; only the state each live view ends up with, and the durability ordering inside deletion, changed.
Split-unit issue reference
No approved upstream issue exists for this change. This pull request is one unit of a declared split of a larger change, and the split plan, the unit boundaries and this unit's acceptance criteria are recorded on the tracking issue in this repository: #1992. That issue is the home for this unit's review dispositions and follow-up registrations, which is why no approved issue is linked above.
AT-HEAD review walkthrough triage (head 8a43f2b)
All 31 review threads are resolved. The nine latest AT-HEAD walkthrough rows were re-verified against this head:
viewIdadoption (ClineProvider.tsload/rekey) - addressed:rekeyPersistedViewStateEntrytreats temporary ids as session counters; a stable entry wins and the temporary entry is dropped, so an unrelated earlier view's entry is not adopted as a stable rekey.undoHistoryWriteassigned without a landed history write - addressed: the closure is a no-op when no history item existed before the switch, and the comment matches the code.deleteApiConfiguration->activateProviderProfilepath (Major) - fixed at 8a43f2b: the deletion now completes the activation-side effects when the deleted profile was the active one (globally or for this view): the manager's own current-profile record and the current mode's profile mapping follow the survivor, the current task's API handler is rebuilt from the survivor's settings, the current task's sticky profile is refreshed, andProviderProfileChangedis emitted. Placement mirrorsactivateProviderProfileUnlocked: after the try/catch, because the deletion has committed. Proofs in the thread reply.openInNewTabcalls (Major) - addressed: the handler unconditionally creates a new panel viaopenClineInNewTab; the tracked-panel reveal is not on the settled path.*InTabvariants, which target the tracked tab instance and are meaningless from the palette, are hidden withwhen: false; the sidebar variants are registered once at activation and target the activation-wired provider directly (no per-view registration, no visible-instance heuristic), which is the pre-unit palette behavior.Verification numbers (head 8a43f2b)
Post-commit activation error distinction (head 91dfd64)
errors.delete_api_config, misreporting a successful deletion. Fixed: the committed state is posted first, then a distinctProfileDeletionActivationError(own moduleprofileDeletionError.ts, re-exported by the provider) is thrown; the handler warns with the activation cause instead of the generic delete error.CI re-trigger: heads e704ab4 and 67a9649 are empty commits over 91dfd64 (no content change) to re-run flaked lanes; the visual lane passed at e704ab4, and 67a9649 re-runs the mock-e2e 30s-timeout flake ('persists completed task across a fresh extension host' - the identical tree passed e2e-mock at 91dfd64). All verification numbers above apply unchanged.
Pre-merge ERROR-row pre-check (head d5c69d3)
setViewStateIdnow rejects non-string ids (crafted postMessage), bounds the key length (MAX_VIEW_STATE_ID_LENGTH), and refuses ids already owned by another live instance; a refused view stays on its temporary id against shared state. Regression tests: non-string, oversized, claimed-by-another-view. Negative controls: disabling the ownership check reddens exactly the claim test; widening the length bound reddens exactly the oversized test; restores byte-exact (hash match)._saveViewLocalStateFromMutationpersists the non-secret subset before updating the buffer; the re-key is a single queued write (no delete-then-write window; authorship clears only after the write lands); the mutation hook keeps the buffer synced across setValue/setValues and profile upsert/activation/deletion.rePinViewLocalStateForDeletedProfilere-pins other live views still buffered on a deleted profile (buffer + durable entry), and deletion snapshots/compensates every store it rewrites. Re-key persistence: single queued write, temp entry survives a failed write.--max-warnings=0clean; tsc clean except the two known local telemetry-dist noise lines; prettier merge-ref gate ALL-MATCHED.upsertProviderProfilewithactivate=false, and the zoo-gateway callback's non-active path) rewrote the profile on disk but left pinned views serving the pre-save snapshot; the non-activating branch now refreshes pinned sibling views (and this view when it holds the pin), and the callback routes throughupsertProviderProfileso the refresh cannot be forgotten.getState()no longer spreads the pinned overlay over the shared provider settings (a key the profile never defined leaked in from the shared profile: model id, region, tuning). The overlay is a complete snapshot: used in place, with onlyapiProviderfalling back to shared state.--max-warnings=0clean, tsc clean except the two known local telemetry-dist noise lines, prettier merge-ref gate ALL-MATCHED.Follow-up: overlay read from the view buffer (required-lane fix)
The previous round's overlay-completeness change read the overlay from the merged state values, which also carry the raw
apiConfigurationstate key. That key is a partial patch written by shared-store paths, not a view snapshot: with no overlay present and the raw key partial,getState()served only the partial object and dropped the shared provider settings the previous merge produced (the parallel-mode activation tests caught exactly this - the activated profile's model id vanished; required lane red on the units carrying that spec). The overlay is now read from the view buffer itself, where a present value is by contract a complete profile and an absent one means the shared store serves the settings.Proofs: ClineProvider.parallelMode.spec green where present (the six synchronization tests that regressed), ClineProvider.spec green including the overlay-completeness tests, sticky-mode and webviewMessageHandler green; negative control: reverting the overlay to a shallow merge over the shared settings still reddens exactly the leak test; restores byte-exact (hash match); eslint
--max-warnings=0clean; tsc clean except the two known local telemetry-dist noise lines; prettier merge-ref gate ALL-MATCHED.Follow-up: active task handlers rebuilt on non-activating saves (head 7b107d3)
A review round on the view-identity unit found that the non-activating-save refresh updated pinned views' buffers but not their active tasks' API handlers, and the posted state prefers the task's own
apiConfiguration: a conversation running in a view pinned to the saved profile kept sending the old token (e.g. after the Zoo Gateway callback rotated it) even though the view's buffer had caught up. The refresh now rebuilds the affected tasks' handlers in the pinned views, and the non-activating branch rebuilds this view's own handler when it holds the pin.Proofs: ClineProvider.spec green (the pinned-sibling refresh test now asserts the active task's handler is rebuilt with the saved settings, not just the private buffer); negative control: dropping the rebuild from the refresh reddens exactly that assertion, restores byte-exact (hash match); parallelMode/sticky-mode/webviewMessageHandler green; eslint
--max-warnings=0clean; tsc clean except the two known local telemetry-dist noise lines; prettier merge-ref gate ALL-MATCHED.Follow-up: test-quality round from the review (head eda590a)
The review round on the api-wiring unit named four test-quality issues; the ones present in this unit are fixed here: the
viewStatesdescribe block moved out of thealwaysDenyUnapprovedCommandsblock (test names carried the wrong subject), the prune test'stoBeDefined()survival checks replaced with exact-shapetoEqualassertions (they pass even if pruning strips fields), the stale-temporary-entry test's fixed 10 ms wait replaced with awaiting the load itself (the negative assertion could pass vacuously on a slow load), and the readiness-cancel test's fake timers restored in afinallyblock (a failed assertion left fake timers active and hung a later real-timer test).Proofs: global-settings 9/9 where present, ClineProvider.spec green, sticky-mode green where present, api-task-control green where present; negative controls: pruning that strips
updatedAtreddens exactly the prune test, aloadViewStatethat adopts the unowned temporary-id entry reddens exactly the stale-entry test, restores byte-exact (hash match); eslint--max-warnings=0clean (src and types); prettier merge-ref gate ALL-MATCHED.Follow-up: review-round fixes from the series (head acfd9ae)
A review round on the mode-profile-writes unit found that the profile-deletion re-pin updated each sibling view'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.Proofs: ClineProvider.spec and sticky-mode green; eslint
--max-warnings=0clean; tsc clean except the two known local telemetry-dist noise lines; prettier merge-ref gate ALL-MATCHED. The rebuild's negative control (dropping it reddens exactly the sibling re-pin test, byte-exact restore) runs in the units that own that test.Updated this round (port of the two upstream PR 1921 review fixes)
acfd9ae -> 54b3890
Ported the two fixes landed on the sibling unit (fork PR 43 / upstream PR 1921 at 2e932e8). This unit carries the same shared code (provider-profile mutation queue + sibling re-pin), so the same review findings apply to this branch:
providerProfileMutationQueueis now shared across instances (static). The per-instance queue let a second view commit between this view's shared write and its snapshot compensation, and the compensation restored a stale copy over the newer write; one queue now serializes every view's profile mutations against each other.Tests: this unit has no
ClineProvider.parallelMode.spec.ts(parallel-mode lineage), so both regression tests land inClineProvider.spec.tsnext to the existing re-pin rollback tests - cross-instance serialization + sibling-task rollback - adapted to this unit's manager-double and saveViewState pin conventions.Proofs:
ClineProvider.spec321/321 (2 new tests); sticky-mode + sticky-profile + webviewMessageHandler 143/143; negative controls: per-instance queue shadow reddens exactly the serialization test, task updates moved back into the per-sibling loop redden exactly the sibling-task test, both restores byte-exact (hash match 7c41a7db88ee1710); eslint --max-warnings=0 clean, suppression counts unchanged; tsc = 2 known donor telemetry-dist noise lines only (real 0); prettier touched files clean and the full merge-ref tree gate ALL-MATCHED @617037b1c (base 54b3890).Updated this round (CodeRabbit follow-up, head 28e969c)
taskApiConfigName === saved profile; pinned-view overlays still refresh. Regression tests cover both sites (negative control: removing either guard reddens exactly its test).Updated this round (CodeRabbit follow-up 2, head 9afc9d8)
taskApiConfigName === deleted profile(the view-buffer re-pin stays unconditional), so a pinned view whose task follows another sticky profile keeps its conversation's settings and persisted profile name. Regression test included (negative control: removing the guard reddens exactly that test).Stryker suppression comments removed
Per the AGENTS.md policy (never add Stryker directives; remove them when a file is touched), all
// Stryker disabledirectives were dropped from this PR. Equivalence rationale for the removed suppressions:CR round 2026-10-15
resetState()now broadcasts across live providers (broadcastResetToAllInstances, the same slice this series ships in the cross-instance-reset units): the shared durableviewStatesslot is cleared once through the persisted write queue, every live view's in-memory buffer (which can hold a deleted profile's settings, API keys included) is dropped, and each sibling view is reposted. Regression test added; dropping the broadcast reddens exactly that test.saveApiConfiguration/renameApiConfiguration/getListApiConfigurationhandlers, launch-timelistApiConfigMetasync).Row-9 update (head 0dae49a)
deleteProviderProfilenow re-points persisted pins of disposed views onto the surviving profile, records the write in the landed-flags set, and rolls the exact pre-deletion map back through the serialized queue on failure (CR Persistence Integrity).Verification: new tests are focused negative controls (reverting each guard reddens exactly the matching test); ClineProvider.spec, webviewMessageHandler.spec spot-checks, api specs, spec-inclusive tsc --noEmit, eslint --max-warnings=0 (suppression counts unchanged) and prettier all green on this head.
Upstream refresh (head 0dae49a)
Merged the current
upstream/main(merge commit; the row-9 fix commit is unchanged and is the first parent) to clear the review gate's mergeability hold. Upstream refactoredupsertProviderProfileinto a newpersistProviderProfilemethod and added arunToCompletionqueue option; this unit's transactional body was ported into the new method unchanged and upstream'sPromise.allSettledactivation fix was adopted in it. One deliberate adaptation: upstream optsupsertProviderProfileintorunToCompletion; this unit does not, because its contract is the landed-write compensation - the mutation timeout must abort the run so the compensation rolls the record and the stores back, which is what the cancellation tests pin. ClineProvider.spec, webviewMessageHandler.spec,tsc --noEmit, eslint (suppression counts unchanged) and prettier re-verified green at this head. The first refreshed head's windows unit-test lane caught that upstream's newupdateProfileModeltests inClineProvider.apiHandlerRebuild.spec.tsmock the settings manager with a staticgetProfile, which starves the post-save read-back; the mock now repointsgetProfileat whatsaveConfigwrote (the real manager's behavior), and the file's 38 tests pass locally alongside the rest of the verification set. Three of upstream's new tests are adapted to this unit's abort-and-compensate upsert semantics (documented in comments): the timed-out upsert cancels and rolls back instead of running to completion, and the restore-path tests account for the compensation's record rollback and the serialized write order.Round 2 (head 4d002c4, then merged to 1c1ac88) — CodeRabbit 00:44:15Z coverage rows
Two Trivial threads from the 00:44:15Z review on
c2206c5a3, both answered test-only, written test-first and measured against the pre-change implementation before any assertion was kept:src/core/config/__tests__/ProviderSettingsManager.spec.ts: storage-read-failure tests added in theDeleteConfigblock (line 986) and theLoadConfigblock forgetProfile(line 1139), in the shape the review specified. Both measure green againstc2206c5a3:deleteConfigrethrows a storage outage asFailed to delete config: …,getProfileasFailed to get profile: …, andload()asFailed to read provider profiles from secrets: …, so nothing is laundered intoProviderSettingsNotFoundErrortoday, anddeleteProviderProfile's not-found-only swallow (src/core/webview/ClineProvider.ts:3608-3617) cannot mistake an outage for a missing profile and prune a list entry whose record is still stored. Controls, one implementation edit each: typing the outage as not-found indeleteConfig→1 failed | 64 passed(theDeleteConfigrow); the same ingetProfile→1 failed | 64 passed(theLoadConfigrow); production restored byte-identical (ProviderSettingsManager.tssha256 prefixc558dde7f04939ee).src/core/webview/__tests__/ClineProvider.sticky-profile.spec.ts: new test after the mid-deletion case —leaves a sibling view's shared settings on the survivor it activated mid-deletion. A second view, sharing the acting view's ContextProxy the way production builds the tab view (activate/registerCommands.ts:449; documented atsrc/core/webview/ClineProvider.ts:3634-3636), activatesother-survivorinside the interceptedmanager.deleteConfig; after the deletion both views'getProviderSettings().openRouterModelIdmust readopenai/gpt-4o. This also measures green againstc2206c5a3: the shared settings are not stale at that interception point today. Controls: dropping the activation's write of the survivor's settings (src/core/webview/ClineProvider.ts:4100) →1 failed | 25 passed; making the deletion push its own entry-time survivor's settings over the shared store even though nothing re-points →1 failed | 25 passed; restored byte-identical (ClineProvider.tssha256 prefixcb8f121752f6ce5f).Assertion shapes are stated in the threads as the repo standard for both classes — storage-failure assertions (
mockRejectedValue(new Error("Storage failed"))→ catch →not.toBeInstanceOf(ProviderSettingsNotFoundError)→toMatchObject({ message: expect.stringContaining("<method prefix>:") }), plusexpect(mockSecrets.store).not.toHaveBeenCalled()on write paths) and cross-view assertions made against a shared ContextProxy — so #1550 and #1919 converge instead of drifting.Verification at this head: junction pre-flight first (every
src/node_modules/@roo-code/*link in this worktree pointed intosplit-1833/u7and was repointed to this worktree's ownpackages/*),tsc --noEmit0 errors, eslint--prune-suppressions --max-warnings=0 --no-warn-ignoredexit 0 on every touched file with counts unchanged (ClineProvider.sticky-profile.spec.ts15 → 15,ProviderSettingsManager.spec.tsno entries), prettier--checkclean,ProviderSettingsManager.spec.ts65 passed,ClineProvider.sticky-profile.spec.ts26 passed, and neighboursClineProvider.spec.ts475,webviewMessageHandler.spec.ts151,ClineProvider.apiHandlerRebuild.spec.ts39,ClineProvider.lockApiConfig.spec.ts2,ClineProvider.flicker-free-cancel.spec.ts13.Upstream merge (head 1c1ac88, parents 4d002c4 + e943530)
git merge upstream/main(e943530 — #2223 time/date-format settings on top of #2294 and #1207) conflicted in three files; each is resolved toward main's content with our behaviour kept beside it:src/core/config/ContextProxy.ts: main'supdateGlobalStateowns the rejected-write contract now (per-key write owner, cache corrected by reading the Memento back), so our per-key generation/confirmed-valuestateWritesmap is removed rather than run in parallel with it.ContextProxy.spec's rejection test gained the Memento content its fixture was missing (mockGlobalState.getnow models what storage holds), because the correction reads from the Memento and not from our cache; the assertion itself is unchanged and still reddens (4 failed | 62 passed) when the read-back line is removed.src/core/webview/ClineProvider.ts: kept our per-view layer and the shared-write compensation insetValues, folded main'swithoutInvalidDisplaySettingsgate in ahead of our mode gate (different key classes, both keep their logs), and took main's three new fields (timeFormat,dateFormat,showRelativeTimes) intogetStateToPostToWebviewread frommergedStateValuesrather thanstateValues, so the per-view overlay still applies to them.src/core/webview/webviewMessageHandler.ts: main'sisInvalidDisplayValueguard first, then our provider-profile and host-owned boundary guards; all three log and drop the key, and none reorders the normalisation below them.Suppression effect of the merge: two counts decreased (
api/providers/__tests__/lm-studio-timeout.spec.ts3 → 0,api/providers/qwen-code.ts1 → 0), none increased. Post-merge verification at 1c1ac88:tsc --noEmit0 errors; eslint exit 0 on all eight touched files; prettier reports every touched file unchanged;ContextProxy.spec.ts66,ProviderSettingsManager.spec.ts65,ClineProvider.sticky-profile.spec.ts26,webviewMessageHandler.spec.ts185,ClineProvider.apiHandlerRebuild.spec.ts39,ClineProvider.lockApiConfig.spec.ts2,ClineProvider.flicker-free-cancel.spec.ts13,extension/__tests__/api-configuration.spec.ts9, and the webview-ui settings/timestamp lane (LanguageSettings.timeFormat,SettingsView,SettingsView.change-detection,ChatRow.timestamp,MessageTimestamp) 133 passed.Round 6 (gate-threads)
Two things landed here since
0579f8d04.2b7a41d58— the shared store stays paired with the selection when a deletion races a sibling write. This started as a measurement, not a guess:deleteProviderProfiledecides what the shared provider-settings store owes the selection once the record is gone, but every guard in that decision keys off something re-pointing at the survivor. Every view in the host shares oneContextProxy(ContextProxy.getInstance, passed to the sidebar atextension.ts:241and to a tab provider atregisterCommands.ts:437/453), so a sibling can move the shared selection onto a survivor and carry the name alone; when that write lands after the deletion re-reads the selection, no live pin, no persisted pin and not the acting view's own pin name the deleted profile, so all the guards stay closed and the store goes on carrying the deleted profile's settings under the survivor's name - which is what every view without an overlay of its own serves. The repair works from the invariant: when the selection names a surviving profile, this deletion wrote no shared settings, and the store still equals the deleted profile's stored record, read the selected profile's settings, pin into their overlays any view that would otherwise inherit them, and replace the store. A sibling write that did carry settings has already repaired the pairing and the record comparison leaves it alone. Regression test plus controls: without the production hunks the file reports1 failed | 498 passed (499), the failure showingapiKey: "doomed-key"underkeeper-profile; with them,499 passed. Full suite after the change:46 failed | 12779 passed | 37 skipped (12862)against a pre-change baseline run of47 failed | 12777 passed (12861)- one test added, no new failure (the difference in failures is a flakingTask.spec.tscase that passed this time). No test on either branch had ever exercised this interleaving: the four deletion tests that write the selection inside an async callback are all single-provider, and the only mid-deletion second operation writes the selection through the same provider's queue, so it settles after the deletion.Thread state. Rows
DOSK-bwM6z6OCB,OCN,OCP,OCS,OCbandVopare answered with the commit that landed each fix on this branch and the control numbers from that landing, and resolved. RowOCX(thepostStateToWebviewinside the compensated write group) is answered and left open: the non-fatal post helper it describes has never existed on either branch (git log -Sfinds no commit carrying that string), so it has to be written, and which branch carries it is the lead's call. The new row4477073508onsrc/activate/registerCommands.ts(track every live tab panel; select a survivor when the tracked one closes) was verified against2b7a41d58and is valid -onDidChangeViewStateat 492-508 already assumes several tab panels stay live whileonDidDisposeat 511-520 only clears the reference - answered and left open pending its own commit on this branch.Round 6 addendum (gate-threads)
Row
4477073508is no longer open. It landed on this branch asbc729fcc9, its own commit: the successor for the tab ref is now chosen deliberately from the live tab-mode provider instances (preference: active, then visible, then any live panel), theonDidDisposeguard reads "no live panel is tracked, or the tracked one is this panel" because the provider's own view-dispose handler clears the ref first, and the last-live-panel case is pinned as its own test so the ref stays clear there rather than pointing at the panel that was just disposed. Controls and the tier measurements are on the thread; the row is resolved.That moved the parent head, so
vps2-f2c's merge of this branch was discarded and rebuilt frombc729fcc9rather than amended: new merge commite8b2ac051(parentsa691f24c9,bc729fcc9). Full suite on this branch afterbc729fcc9:46 failed | 12785 passed | 37 skipped (12868)- six tests added, same 46 pre-existing environmental failures.Task.spec.tsflakes between runs of the same tree, so a delta in that file either way is not a repair.Round 7 addendum (head 4719931)
This head folds the four open review rows on this branch into one commit:
postStateToWebviewmoved out of the compensated group indeleteProviderProfileUnlocked(log-only failure), so a state-refresh rejection after the deletion committed no longer resurrects the profile record while the sibling re-pins stay on the replacement. Two rollback cases were retargeted onto a failure point inside the group (the re-pinned sibling's own post) so they measure the rollback rather than the position of the refresh; the new case pins that a failed post leaves the deletion committed and logs it. Control: with the post still inside the group, 1 failed / 499 passed - only the new case.disposeFailedTabCreationnow hands the tracked tab ref topickTabPanelSurvivor()instead of clearing it, so a creation failure no longer strands live tab panels; same selector and same pool as the disposal path. Control: reverting that hunk reddens only the new failed-creation case, 1 failed / 69 passed.afterEachhooks resetClineProvider.getInstanceForView/getAllInstances, becausevi.clearAllMockskeeps implementations and survivor fixtures were leaking registry state into later tests.finally, so it stops leaving a live instance in the static registry.Gates on this head: tsc clean, eslint clean with
src/eslint-suppressions.jsonunchanged, prettier--checkclean, hooks (lint-staged, pre-push check-types) ran on both pushes. Focused:registerCommands.spec.ts78,ClineProvider.spec.ts500,ClineProvider.sticky-profile.spec.ts26. Full suite 45 failed | 12816 passed | 37 skipped - 40__tests__/dist_assets.spec.ts(no built dist) + 5services/rules/__tests__/rules.spec.ts(Windows symlinks), same environmental classes as the base;src/core/task/Task.spec.tsis a known inter-run flake and did not fail in this run.Related issues