Repository navigation
test(webview): ClineProvider parallelMode suite with viewStates pruning edges - #1921
Open
easonLiangWorldedtech wants to merge 275 commits into
Open
easonLiangWorldedtech wants to merge 275 commits into
easonLiangWorldedtech wants to merge 275 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.
What this PR is
F2c of the parallel-mode/view-state series: the test unit. It carries the
ClineProvider.parallelMode.spec.tssuite plus the unit-owned fixes the testsproved out (independent API tab creation, the MCP hub
_disposedguard, theown-property checks in the view-state re-key, the reset-path durable-clear
isolation, the
SkillsManagerdisposal guard).Replayed onto the landed F2a head
68f4cf790(109 non-merge commits from theold 122-commit chain; the 13
Merge upstream/maincommits of that chain areflattened and their merged content is carried in the net diff).
range-diffbetween the old chain and the replay: 65 commit rows, 15 identical, 50 adapted,
0 dropped, 0 added. Pushed head
a15ce7e72(73 commits on68f4cf790).Landed owns the provider machinery, so the competing shapes came out
F2a/#1919 owns the provider-profile view-state and deletion machinery, so this
unit no longer carries a second design beside it. Rejected in fold (recorded in
the sweep log as competing designs, not as omissions):
providerProfileMutationQueue(landed owns aninstance queue),
deleteProviderProfile(profile, signal)withinnerCompensationRan(landed's deletion path is unqueued and not abortable),ContextProxy.updateGlobalStateplus awritePersistedViewStateshelper (landed already implements generation-guardedrollback; the helper had no caller).
Also reverted: the draft's
temporaryViewStateIdfield (landed keys thetemporary identity off
viewId+wroteUnderTemporaryViewStateId),modeMutationGeneration/cancelledModeSwitchSnapshot, the duplicatedrepointPersistedViewStatescopy, the unusedincludeSelfparameter on thesibling refresh, and the pinned-profile-with-overlay ordering — that last one
contradicts a landed contract test (
should keep the persisted profile name and log when the profile lookup fails), which pins the name even when the lookuprejects.
Tests follow the settled tree
The unit's tests assert what the settled tree does, not what the draft used to
do. Dropped together with the designs they covered:
ClineProvider.spec.ts: the deletion-abort test (stops writing durable state once the deletion's abort signal fires) and the threewritePersistedViewStatesrollback tests.
ClineProvider.parallelMode.spec.ts(7 tests, contracts the settled tree doesnot implement):
reloads the pinned profile for a view pinned to a different profilerefreshes a sibling overlay when the profile is saved without activationrefreshes the acting view's own overlay when it saves the pinned profile without activatingrolls back every durable write when the per-view pin write fails during an activating upsertrestores the profile list and the manager's current profile when an activation is rejectedleaves every sibling task on the deleted profile when another sibling's re-pin is rejectedsurfaces an explicit inconsistent-state error when the compensation itself failsClineProvider.sticky-mode.spec.ts: the 18 draft-only tests in that file arenot carried. test(webview): ClineProvider parallelMode suite with viewStates pruning edges #1921 is the test unit for this surface, but every one of those 18
asserts behaviour the draft-side implementation supplied (abort-compensated mode
switches,
temporaryViewStateIdauthorship tracking, compensating a durable modewrite after an in-flight abort). The landed unit does not implement them, so the
coverage is an inherited gap that lives at the implementation-owning unit
(test(webview): F2a - profile-mutation state semantics and the mode-rollback guard #1919) — this PR does not remove coverage that test(webview): F2a - profile-mutation state semantics and the mode-rollback guard #1919 shipped; test(webview): ClineProvider parallelMode suite with viewStates pruning edges #1921 does not
ship tests for behaviour its base does not have.
the 18 draft-only sticky-mode tests (title list)
restores the view's own mode pin when a task listener throws after the durable writerestores the view mode pin even when the shared-mode rollback write failscompensates the durable mode write and emits nothing when the signal aborts while the write is in flightbails out before any task write when the mutation signal is already abortedrolls back the landed history write and leaves no partial mode state when the signal aborts in flightcompensates the durable mode write when the signal aborts after it landsrolls the durable mode write back when a post-write profile lookup rejectsrestores the shared mode and the acting view's pin separately when the switch is cancelledcompensates the durable mode write when the abort lands while the profile lookups are in flightcompensates when the abort lands between the durable write and the profile lookupscompensates when the abort lands while the activation profile is being readreports an inconsistent state when the cancelled mode switch cannot restore the previous modedoes not compensate over a mode that a newer mutation committedkeeps the cancellation result when the abort rollback write itself failspreserves fields persisted during the pending window when rolling back the modeproceeds normally when no mutation signal is providedshould handle errors during mode switch gracefullyrolls the task-history write back when the durable mode write failsClineProvider.spec.ts,ClineProvider.sticky-profile.spec.tsandwebviewMessageHandler.spec.tsare back to the landed blobs: every differencethere was either a merge-generated duplicate or a draft assertion about behaviour
the settled tree does not have.
Suppressions
src/eslint-suppressions.jsonis byte-identical to the landed base blob29e6919eff14a4eed0b0d7c7b0166097584099db, so restricted to touched files thedelta is zero increases and zero decreases; nothing was suppressed to make
the gate pass. (
03b403a8f7is the pre-rebase draft figure and history only —the comparison base for the never-increase rule is the new base blob.)
Gates on the settled tree (all against
68f4cf790)pnpm --dir src exec tsc --noEmit --incremental falsepnpm --dir src exec eslint --max-warnings=0 --no-warn-ignored(every touchedsrcfile)pnpm --dir webview-ui exec eslint --max-warnings=0 --no-warn-ignored(touched file)pnpm --dir packages/types exec eslint --max-warnings=0 --no-warn-ignored(touched file)prettier --checkon every touched filepnpm --dir src exec vitest run core/webview activate --no-file-parallelism --test-timeout=30000pnpm --dir packages/types exec vitest run src/__tests__/global-settings.test.ts --no-file-parallelism --test-timeout=30000pnpm --dir webview-ui exec vitest run src/utils/__tests__/vscode.spec.ts --no-file-parallelism --test-timeout=30000pnpm run check-types(tsc -p tsconfig.json --noEmit && turbo check-types)src/eslint-suppressions.jsonvs the landed base blob29e6919eUnit delta against the new base: 11 files, +1535/-25 (the pre-rebase draft head
56fadab5fwas 17 files, +14,675/-605; the difference is content the landed F2a unit already owns, plus tests for behaviour the settled tree does not implement).Campaign notes
pre-commit/prepare-commit-msgfor commits created byrebase --continue,so the equivalents (
eslint --max-warnings=0 --no-warn-ignoredon every touchedfile,
prettier --writethen--check, plus rootcheck-types) were runexplicitly against the settled tree.
.husky/_/pre-pushwas missing in this worktree. husky regenerates.husky/_with its own stub set, and
pre-pushwas not in it whilecore.hooksPathpointsthere — a push from this worktree would have silently skipped root
check-types.The 39-byte stub was recreated and verified before pushing.
src/node_modulesis a real directory mirroring the siblingworktree's install with
@roo-code/typesjunctioned into this worktree's ownpackages/types(verified withfs.realpathSyncandts.resolveModuleNameundermoduleResolution: Bundler);apps/cliandapps/vscode-e2enode_modulesweremissing and junctioned too, because root
check-typesruns@roo-code/cli#check-types.upstream/mainfirst looked like a single squashed commit because the sharedobject store was shallow; after
git fetch --depth=400 upstream mainthe merge-base ofthis unit's base
68f4cf790and main is3ee042d91, andmain × 68f4cf790merges clean(tree
4081fdbbb), so this PR keeps its base on main with merge order declared in thetracking issue instead of being re-derived. Main has since moved to
6bbc7a091(feat(tools): add dependency-free BM25 ranker #1207).duplicated content before re-implementing anything: main's
ClineProvider.tscarriesproviderProfileMutationQueueanddeleteProviderProfile(but none ofdeleteProviderProfileUnlocked,innerCompensationRan,temporaryViewStateId,wroteUnderTemporaryViewStateIdorwritePersistedViewStates, and main'sregisterCommands.tshas none ofopenClineInNewTabForApi,apiTabPanelCreation,createTabPanelUnlockedor thegetInstanceForView(tabPanel)recheck, so this unit'scontent is not duplicated by feat(api): abort-signal wiring for lm-studio and qwen-code (round 2) #1309 (its abort work sits in the API-client layer).
.changeset/files and no CHANGELOG edits (AGENTS.md).Review-driven fixes on this head
Round 1 -
33f56ca7b: telemetry rebinding (rt4461685303)rt4461685303(src/activate/registerCommands.ts:507, Minor · Functional Correctness ·Quick win) asked to rebind telemetry to the raced tab provider before disposing the new one.
Fixed in
33f56ca7b:TelemetryService.instance.setProvider(racedProvider)now runs beforeawait tabProvider.dispose().ClineProvider's constructor had already rebound telemetry tothe provider this call throws away, and
BaseTelemetryClientkeeps only aWeakReftowhatever was bound last, so an event captured while that provider is being disposed read its
properties off the instance being thrown away rather than off the tab that was returned.
Pinned by a regression test in
src/activate/__tests__/registerCommands.spec.tsthat drivesthe same raced scenario and captures a
Tab Shownevent from inside the constructedprovider's teardown — the only window in which the binding can still point at the instance
being disposed — and again after the call returned, asserting both carry the surviving tab's
properties; the mocked
@roo-code/telemetryin that spec now mirrorsBaseTelemetryClient.getEventProperties. Control: moving the dispose back ahead of therebind reddens that test (the event comes back with
taskId: "disposed-tab"instead of"surviving-tab"), and restoring it gives byte-identical content -git hash-objectd71ff83c0d070bcd2bef754a7c629656faf87d8f, sha25692004d5fd90834929200126ebe1d384bfe95409e1e77520fec6dc7e7849aa90a.Gates for
33f56ca7b(all against68f4cf790):srctsc --noEmit --incremental falseexit 0; hook-form
eslint --max-warnings=0 --no-warn-ignoredexit 0 insrc,webview-uiand
packages/types;prettier --checkexit 0;vitest run core/webview activate --no-file-parallelism --test-timeout=30000= 40 files, 1215 tests, 0 failed; packages/types19/19; webview-ui 18/18; root
check-types11/11 tasks.src/eslint-suppressions.jsonisbyte-identical to the landed blob
29e6919e(grand total 3301 unchanged; 0 increases and 0decreases restricted to touched files -
ClineProvider.tsstays at 7@typescript-eslint/no-explicit-any,SkillsManager.spec.tsat 2, every other touched fileunlisted). Replied in-thread (4475425600); the thread is resolved.
Round 2 -
a15ce7e72: the four threads from review 5778294951, and the red required laneReview 5778294951 (CHANGES_REQUESTED on
b0cb66e1b) left four live threads; all four take,and all four are fixed in one commit with a control each.
src/__tests__/extension.spec.tsassertedopenClineInNewTabwhileClineProviderFactory.createInNewTab()has calledopenClineInNewTabForApisince thisunit's rename, so the mock never exposed the export production reads. That was not a
vacuous assertion but a red required lane:
platform-unit-test(ubuntu-latest), grouptest:coverage:misc,1 failed | 2040 passed | 24 skippedonextension.ts > injects a factory instance with this activation's dependencies without reading the sidebar tracker, the same case already red atb0cb66e1b(1 failed | 2039passed), which is why test(webview): ClineProvider parallelMode suite with viewStates pruning edges #1921 went from 7/7 to a red required lane before this push. Control
with only the assertion retargeted and the mock left alone: 23/24, failing on
No "openClineInNewTabForApi" export is defined on the "../activate/registerCommands"mock; mock and references retargeted together so the test drives the export productioncalls: 24/24. The full
srcsuite joins the per-round gate set from here on.settingsButtonClicked,historyButtonClickedandmarketplaceButtonClickedpostedwithout checking
isViewLaunched. All three are also on the command palette, andpostMessageToWebviewreturns without sending while the view is unset, so a paletteinvocation did nothing and wrote no log. All three now await
waitForSidebarView-plusButtonClicked's existing sequence (focus the pane,await whenViewResolved()) liftedto module scope, which
plusButtonClickeditself now calls rather than a fourth shape. Onetest per handler: view unresolved, command invoked, nothing posted and nothing logged before
the gate releases, actions delivered in order after it, plus the
[<prefix>] postMessageToWebview failed:entry so a failed post cannot stay silent either.Control: dropping the await from the three handlers reddens exactly those three tests (67/70
with the settled tree at 70/70).
SkillsManager.spec.tsassertedcreateWatchercall history after thefinallyblock'smockReset()had cleared it. The assertions now run inside thetry, before the reset, andthe test also asserts the observable -
watchersis empty - alongside the undisposed filter.Control: with initialization creating (and disposing) a watcher by hand the fixed test
reddens at 94/95 (
expected [ { ...(4) } ] to have a length of +0 but got 1) while thepre-fix body stayed green at 95/95.
registerCommands.spec.tsleaked its per-test stubs because this file'sbeforeEachusesvi.clearAllMocks(), which clears call history but leaves implementations installed. TheMdmService.getInstancestub is nowmockReturnValueOnce, and eachContextProxygatereturns once per creation it has to serve (two where the test starts an ordinary and a forced
creation, one where only one creation reaches the proxy). Control: a probe asserting that the
next tab creation sees the automocked default again fails with the persistent stub
(
expected { name: 'mock-mdm' } to be undefined, 70/71) and passes with the one-shot stub(71/71). Their two corrections hold: the
:1113assertion is not caused by that stub, and theContextProxygates are isolation hygiene rather than evidence for an order-dependentresult.
Gates for
a15ce7e72(all against68f4cf790):srctsc --noEmit --incremental falseexit0; full
srcvitest run12556/12644, the 51 local failures confined to specs byte-identicalto the landed base (built dist assets, pwsh/bash shells, swift tree-sitter, symlinked rule
dirs - CI reports those groups green);
vitest run core/webview activate= 40 files, 1218tests, 0 failed; packages/types 19/19; webview-ui 18/18; hook-form
eslint --max-warnings=0 --no-warn-ignoredexit 0 over the 10 touchedsrcfiles and both packagelanes;
eslint --prune-suppressionsleavessrc/eslint-suppressions.jsonbyte-identical tothe landed blob
29e6919e- grand total 3301 before and after, 0 increases and 0 decreasesrestricted to touched files (
ClineProvider.ts7@typescript-eslint/no-explicit-any,SkillsManager.spec.ts2, every other touched file unlisted);prettier --checkexit 0; rootcheck-types11/11 tasks withzoo-code:check-typesexecuted on this tree (cache bypass, force executing 4ae11f004a4acab5,Cached: 0 cached, 11 total) rather than read from cache.Two stale
line: nullrows from review 5760938067 were answered once and resolved: theempty-group observation is carried at
src/activate/registerCommands.ts:503-505with the racedbranch now at
:514-527(behaviour unchanged, path untouched by this round), and therename/selection observation is superseded by the activation-with-rollback shape at
src/core/webview/webviewMessageHandler.ts:2703-2727in content this unit inheritsbyte-identically from
68f4cf790. All six threads are resolved with in-thread replies. The tworeds on the pushed head are not this unit's:
webview-visualrecords the sameWelcomeViewProvider.visual.tsxhigh-contrast-light contrast failure (contrast.ts:198) thatmain's own merge-queue run recorded at 6bbc7a0 (job 126965861148), on vps2-f2a at c2206c5
and on fws/u8-diffview at e36a779, and
mutation-difffails the aggregate size gate (2138changed executable lines against a 500 limit) exactly as it did at
b0cb66e1b(2132).Round-4 rows closed at 5cbdcf1
5cbdcf17e(parent48198939b, branchvps2-f2c) closes the ten open round-4 CodeRabbitrows (root comments 4475848261-4475848350): eight files, +747/-53, no
.changeset, no CHANGELOGedit,
src/eslint-suppressions.jsonbyte-identical to HEAD. Every row is answered in-thread andresolved; no review was requested and no
@coderabbitaimention was added.The Major row (sibling re-pin ordering): the surviving profile task-handler rebuild is deferred
until every sibling re-pin has resolved, a sibling whose re-pin rejected has its pin and overlay
restored and is left out of the rebuild, and the rollback is split per surface so a failed pin
restore no longer hides a failed task restore (
restoreFailuresfeeds the thrown aggregate).New test:
does not rebuild the healthy sibling's task handler when another sibling's re-pin fails(ClineProvider.spec.ts:7393).The deletion now runs inside the write group it was written around: public
deleteProviderProfilehands the whole body toenqueueProviderProfileMutation(
ClineProvider.ts:3583-3591) over the unchanged privatedeleteProviderProfileUnlocked, takingthe queue to five call sites (2815 mode switch, 3290
saveProviderProfile, 3320updateProfileModel, 3590 deletion, 4136 activation). Re-entrancy was counted rather thanassumed: inside the deletion body and the re-pin helper there are 0 occurrences of each of
activateProviderProfile,handleModeSwitch,saveProviderProfile,renameProviderProfile,updateProfileModel,persistProviderProfile,deleteProviderProfileandenqueueProviderProfileMutation, so the deletion never takes the queue twice.lets an activation that starts mid-deletion run after the deletion settles(
ClineProvider.spec.ts:5748) parks the deletion indeleteConfig, starts an activation,releases it, and asserts the resulting selection, pin, persisted list and cleared view overlay;
with the wrapper replaced by a direct
deleteProviderProfileUnlockedcall it failsexpected 'keeper-profile' to be 'other-profile'. The concurrent-upsert test now orderssave:new-profileaftersave:doomed-profile- the deletion own restore write, filtered byprofile name - and reddens
expected 0 to be greater than 1under the same unqueued control.Mode switch:
updateTaskHistorylands the mode before theTaskModeSwitchedemit, the secondcatch restores in write order (history entry mode,
task["_taskMode"],setValue("mode", ...)), and the announcement moved out of the persistence try so a listenerfailure cannot undo a mode the switch kept. Two new tests (
ClineProvider.sticky-mode.spec.ts:566listener-throw history mode,
:626pin survives a profile-tail failure) accompany thestrengthened existing test, whose
updateTaskHistorydouble now applies the write instead ofswallowing it. The two
toBeUndefinedpin assertions in the emit-throw test are stated for whatthey are: no pin write happens on that path, so they cannot fail. Measured rather than argued -
swapping the persist/buffer order gives
Tests 31 passed (31), while skipping the mode in thedurable write, or in the view-local buffer, gives
Tests 4 failed | 27 passed (31)each, whichis what the new pin test reddens against.
deleteApiConfigurationfalls back to the UI-facinglistApiConfigMetaentry when the storedrecord is already gone (
webviewMessageHandler.ts:2814-2819), so a stale selector entry goesthrough the idempotent prune instead of being undeletable from the UI. A second test pins the
other side of the fallback: a name in neither list stays a no-op - no
deleteProviderProfilecall, no manager write, and only the existing
errors.delete_api_configtoast, which was keptrather than silenced because a click naming a profile that is in neither store means the webview
state is already stale. The reset/owner-token row is recorded as a thread whose premise our merge
invalidated rather than a fix: main per-key owner tokens replaced the generation map and
previousCachedValuerestore the row describes, andContextProxy.spec.ts:161now pins themechanism that is actually on the head.
Merge integrity check over every spec file that differs from the merged main commit
e943530c8: 15 files carry main-side test titles, 839 distinct titles, 832 survive verbatim. Theseven that do not are each accounted for. Main
creates diagnostics from all provider instances without requiring a visible providerwas droppedby our own merge resolution and is re-adopted at
registerCommands.spec.ts:258(control-checked:replacing
providers: ClineProvider.getAllInstances()withproviders: []turns it red). Fourothers in the same file are the click-origin rework renaming an existing case rather than losing
it:
... when no sidebar panel is activeis carried as... when no sidebar panel is trackedand... on the visible provideras... on the registered sidebar provider, while the twono-visible-provider cases are carried by
getVisibleProviderOrLoglogging and returning undefinedplus the tab-instance no-ops for
settingsButtonClickedInTabandfocusInput ... without a live tab instance- the visible-instance lookup those tests assertedabout no longer exists in the handlers.
timed-out mutations abort before writing state and advance the queuedescribes abort-on-timeout semantics that200365600replaced withrun-to-completion, carried by
timed-out activations run to completion and hold the queue,holds the next profile mutation until a timed-out model update settles,finishes activation after the caller timed out instead of leaving a saved but ...andan activation that times out while queued behind another never starts. Main genericshould handle errors during mode switch gracefullywas specialised by68f4cf790into thelistener-throw, profile-tail and save-failure cases above.
Gates on this head:
tsc -p tsconfig.json --noEmitexit 0; plaineslint --max-warnings=0 --no-warn-ignoredexit 0 on every touched file;prettier --check .exit 0; the fullsrcsuitereports
Test Files 2 failed | 566 passed | 3 skipped (571)andTests 45 failed | 12805 passed | 37 skipped (12887), where all 45 are environmental here: 40 in__tests__/dist_assets.spec.ts, which asserts builtdist/*.wasmassets exist and this worktreehas no
dist/, and 5 inservices/rules/__tests__/rules.spec.tssymlink cases failingEPERM: operation not permitted, symlink ...under this Windows sandbox - the same 40 + 5 as at48198939b. CI on the pushed head: 44 check runs success, 1 skipped, 9 still running, andmutation-diffred exactly as it was on48198939b(run 127045035952 here,127015126885 there, same aggregate-size gate; its log surfaces only
Process completed with exit code 1.as an annotation, so no line count is quoted from it here).Round-5 rows closed at 5163cd3
5163cd3e9(parent5cbdcf17e, branchvps2-f2c) closes three of the four rows in the newestCodeRabbit pass (root comments 4476213569, 4476213576, 4476213623): 22 files, +94/-33, no
.changeset, no CHANGELOG edit,src/eslint-suppressions.jsonbyte-identical. Each row is answeredin-thread and resolved; no review was requested and no
@coderabbitaimention was added.The deletion-activation warning took its text from the error class, so it was the one notification in
webviewMessageHandlerthat a non-English user saw in English. It now readst("common:warnings.profile_deleted_activation_failed", { name: error.replacementProfileName })(
webviewMessageHandler.ts:2852-2856), and the key is present in all 18src/i18n/locales/*/common.jsonwarningsblocks with the profile name interpolated. Each locale got atranslation rather than English pasted into every file, and
jawraps the name in the corner bracketsits own bundle already uses. The error class keeps its own message for the log line above, where the
cause text belongs. The bundle wording deliberately differs from the class sentence: an assertion that
expected that sentence verbatim would also have passed for a handler that never asked i18n. Reverting the
handler to
error.messagemeasuresTests 1 failed | 186 passed (187); at this headwebviewMessageHandler.spec.tsisTests 187 passed (187)andlocale-bundles.spec.ts- which already pinnedthe error key this unit adds - is
Tests 18 passed (18), with the added warning key pinned alongside it.The rename rollback's ordering assertion compared an index into
deleteConfig.mock.callswith an indexinto
saveConfig.mock.calls:deleteOldCallis 0 andrestoreOldCallis 1 in every run of this flow whateverthe real order is, so
1 > 0could not report the regression its own comment names. It now compares thetwo mocks' shared invocation clock, with both indices asserted to exist first. Measured: moving the
rollback's
saveConfig(oldName, previousRecord)ahead of the rename'sdeleteConfig(oldName)- the orderingbeing claimed - fails with
expected 716 to be greater than 717at that assertion; at the landed order thesuite is
Tests 187 passed (187).The overlapping-write cases in
ContextProxy.globalStateRestore.spec.tsran the same scenario twice: thefixture rejected both writes at once, so both rejection handlers ran in creation order and the
B settles firstcase never exercised B-before-A. The memento double now parks eachupdateuntil the caserejects it, and
expect(pending.map((p) => p.value)).toEqual(["a", "b"])pins which parked write is which beforeeither rejects. The split was measured on the design this guard replaced (each rejection restoring the
cache value that write found, as the generation map did): there
A rejects firstfailsexpected 'a' to be 'X'whileB rejects firststays green, so a guard that broke only for the B-before-Ainterleaving can no longer pass both. At this head both cases pass -
Tests 5 passed (5)- because theolder write leaves the cache alone and the owner reads the value back from the store.
The fourth row (4476213612, a failed sibling state post aborting
resetState) is measured anddeliberately not fixed here. The sibling loop at
ClineProvider.ts:6177awaitsinstance.postStateToWebview()with no guard, so the reset does stop there: a test that parks a sibling'spost on a rejection and then asserts that
resetState()resolves and thatresetAllConfigs,resetCustomModesandremoveClineFromStackall ran measuresTests 1 failed | 497 skipped (498)withpromise rejected "Error: webview is gone" instead of resolvingon this head, andTests 1 passedwith anine-line guard mirroring the one
broadcastResetToAllInstancesalready uses. That is a behaviour change inthe reset path #1562 and #1565 inherit, so it is held for review rather than landed unilaterally, and
the thread is left open.
Gates on this head:
tsc -p tsconfig.json --noEmitexit 0; plaineslint --max-warnings=0 --no-warn-ignoredexit 0 on every touched file;
prettier --checkexit 0 across the touched sources and all 18 localebundles;
ContextProxy.globalStateRestore.spec.ts5 passed,webviewMessageHandler.spec.ts187 passed,locale-bundles.spec.ts18 passed. Full src suite on this head:Test Files 2 failed | 566 passed | 3 skipped (571)andTests 45 failed | 12805 passed | 37 skipped (12887)- the same 40dist_assets.spec.tscases (no
dist/built locally) and 5rules.spec.tsEPERM ... symlinkcases as the previous head, bothoutside this diff. CI at the pushed commit: 25 check runs, 15 success, 6 in progress, 3 queued, and
mutation-diffred on the aggregate-size gate it has been red on sinceb0cb66e1b(run 127051480319). No.changeset, no CHANGELOG edit, no review request, no@coderabbitaimention.Round 6 (gate-threads)
Two commits since
5163cd3e9.a691f24c9(test-only) answers the last two open rows. Both were the same weak spot - the expected text was built witht(...), so nothing pinned what the handler handed to i18n, and nothing pinned what the bundle handed back. The delete-api-config test now assertsexpect(t).toHaveBeenCalledWith("common:warnings.profile_deleted_activation_failed", { name: "keeper-profile" })before it asserts the warning message; pointing the handler at the deleted profile instead oferror.replacementProfileNamereddens exactly that test (1 failed | 186 skipped (187)). The locale bundle spec now requires each warning this unit adds to be a nonempty string containing{{name}}; dropping the placeholder from the en bundle reddensen defines every key this unit adds(1 failed | 17 passed (18)), and as shipped all 18 bundles carry it (read bundle by bundle). Row4476213612(the unguarded siblingpostStateToWebviewinresetState) was fixed on the parent as42b4b6f9aand arrives with the merge below. All CodeRabbit rows on this PR are now answered and resolved.ec26cc118rebuilds the parent merge from the finished parent head:git merge --no-ff vps2-f2afrom base1c1ac88b71, bringing the parent's eight commits, including2b7a41d58, a fix that exists only on the parent. That fix closes a measured hole: every guard by whichdeleteProviderProfiledecides what the shared provider-settings store owes the selection keys off something re-pointing at the survivor, while all views share oneContextProxy, so a sibling can move the shared selection onto a survivor and carry the name alone - the store then 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. Its regression test fires the sibling's selection-only write from inside the deletion's first durable write, and reverting only the production hunks reddens exactly that test.Residual the merge adds to this branch: 4 files, +260/-1 (
ClineProvider.ts+67,ClineProvider.spec.ts+138,webviewMessageHandler.spec.ts+51,webviewMessageHandler.ts+4).src/activate/__tests__/registerCommands.spec.ts,src/core/config/__tests__/ContextProxy.globalStateRestore.spec.tsandsrc/eslint-suppressions.jsonare byte-identical to5163cd3e9- the ports on the parent rows that this branch already carried deduped byte-for-byte.Gates on the merged tree:
tsc --noEmit0 errors; eslint--max-warnings=0 --no-warn-ignoredclean on every touched file; prettier--checkclean. Focused specs 807 passed across six files (ClineProvider 499, webviewMessageHandler 188, activate/registerCommands 71, ContextProxy.globalStateRestore 5, ClineProvider.sticky-profile 26, locale-bundles 18). Full suite:Tests 45 failed | 12808 passed | 37 skipped (12890)in 92.73s against45 failed | 12805 passed | 37 skipped (12887)on5163cd3e9before the merge - one test added, no new failure. The 45 are the pre-existing environmental classes: 40 in__tests__/dist_assets.spec.ts(no builtdist/in the worktree) and 5 inservices/rules/__tests__/rules.spec.ts(Windows symlinks).Round 6 addendum (gate-threads)
The merge in the section above was built from
2b7a41d58. The parent head then moved: row4477073508on the parent (tab-panel survivor tracking) was verified valid and landed there asbc729fcc9, so the local merge was discarded and rebuilt fresh from the finished parent head -git merge --no-commit --no-ff vps2-f2afrom base1c1ac88b71- giving merge commite8b2ac051(parentsa691f24c9,bc729fcc9).Measured on the rebuilt merged tree: tsc 0 errors, eslint
--max-warnings=0 --no-warn-ignoredclean, prettier--checkclean, focused specs 880 passed across ten files, full suiteTests 45 failed | 12814 passed | 37 skipped (12896)in 104.63s against45 failed | 12805 passed | 37 skipped (12887)on5163cd3e9- nine tests added, no new failure; all 45 are the environmental classes (40dist_assets, 5rulessymlinks). Dedupe re-verified by blob identity:eslint-suppressions.jsonis 69b08043de on every ref and in the merged tree,ContextProxy.globalStateRestore.spec.tsis da408dcfc5 on all four (byte-for-byte dedupe), andregisterCommands.spec.tsgained exactly the parent's 229 new tab-panel test lines and nothing else againsta691f24c9, so the port this branch already carried was not duplicated. The mergedClineProvider.spec.tsis byte-identical to the parent's (e4b09a205e).Correction to the section above: the merge commit there is
e8b2ac051, notec26cc118- the earlier artifact was thrown away rather than amended, exactly as the stack rules require when the parent head moves.Round 7 addendum (head be39ce4)
This head is a fresh merge of the finished parent (
vps2-f2aat4719931e4); the previous merge commite8b2ac051was discarded rather than amended, and the resolution was taken from that merge's resolved text so content already ported from the parent was not duplicated (verified per file by blob hash:git rev-parse ":<file>"againstgit rev-parse <rev>:<file>). The tree differs from the discarded merge by exactly the parent head's delta - 5 files, +249/-45 against the parent's +248/-46, per-file counts matching; the single-line difference is a prettier re-wrap in the merged copy ofregisterCommands.spec.ts.Two review rows were answered here.
registerCommands.ts:477is satisfied by the parent fix carried in this merge.registerCommands.ts:413is answered rather than fixed: on the parent the factory still callsopenClineInNewTabwithforceNew: true, so the branch is the production path there; on this head the unit moved that caller toopenClineInNewTabForApi, which makes the wrapper's option unreachable from production - butcreateTabPanelUnlockedstill consumes the flag from the API entry point, and three of this unit's own cases (gives each overlapping forced call its own providerand the two slot-occupancy cases around a forced call arriving mid-flight) drive it through the wrapper and are the only coverage of the rule that a forced call must not evict an ordinary in-flight creation. Removing it is a rewrite of this unit's own commits, not something to smuggle through a merge rebuild, so the row is left open for the stack owner.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