Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
bf30669
fix(activate): target title-bar commands to their click-origin instance
easonliang28 Sep 4, 2026
854af59
fix(activate): serialize overlapping openClineInNewTab calls and hard…
easonliang28 Sep 7, 2026
cbf0edb
test(activate): pin openClineInNewTab creation branches and strengthe…
easonliang28 Sep 7, 2026
6cc68ef
fix(activate): harden tab creation serialization and centralize title…
easonliang28 Sep 7, 2026
d7453eb
test(activate): pin tracked tab identity against the created panel
easonliang28 Sep 7, 2026
199d072
test(activate): pin the tracked tab panel passed to getInstanceForView
easonliang28 Sep 7, 2026
c1bf947
feat(provider): persist per-view view-state identity and durable view…
easonliang28 Sep 5, 2026
1e952c5
fix(provider): track in-flight view-state mutations per field and exc…
easonliang28 Sep 7, 2026
b16a9e5
fix(provider): restore previous view-state id when registration persi…
easonliang28 Sep 7, 2026
a3c6064
fix(provider): reject invalid view-state modes and sync profile mutat…
easonliang28 Sep 8, 2026
3aec562
fix(package): move command palette entries to the commandPalette menu…
easonliang28 Sep 8, 2026
016c221
fix(webview): sync view-local state with mode and profile mutations a…
easonliang28 Sep 8, 2026
2573858
fix(provider): close mode-switch abort window, drop bracket access, c…
easonliang28 Sep 14, 2026
8d13c64
test(provider): cover abort and pinned profile deletion guards
easonliang28 Sep 14, 2026
2ba6240
test(provider): assert profile settings write identity
easonliang28 Sep 14, 2026
56d797c
fix(provider): make mode switch cancellation atomic and preserve view…
easonliang28 Sep 15, 2026
6c9856d
fix(core/webview): purge deleted provider profile from the settings s…
easonliang28 Sep 15, 2026
67dbd22
test: replace double assertions with single structural casts in view-…
easonliang28 Sep 27, 2026
1004cbd
fix(webview): contain the abort rollback failure in handleModeSwitch
easonliang28 Sep 27, 2026
dfb8264
fix(webview): restore only the mode field when rolling back an aborte…
easonliang28 Sep 27, 2026
ce8b276
fix(activate): drop the CodeIndexManager lookup left by the rebase
Oct 5, 2026
0f02b9c
fix(core/webview): merge view-local state into getState for per-view …
easonliang28 Sep 6, 2026
3887f8e
fix(webview): rebuild F1b on main tip + own delta
Oct 5, 2026
8e4afd7
fix(lint): correct the recorded suppression count for the sticky-mode…
Oct 6, 2026
cd90389
test(webview): seed the re-key entries through the write path
Oct 6, 2026
74f9975
fix(webview): drop the overlay when the surviving profile's settings …
Oct 6, 2026
66026d1
Merge upstream/main @89a90f513 into vps2-f1b-rb
easonliang28 Oct 12, 2026
8c9c55f
fix(webview): validate the webview-supplied view state id before adop…
easonliang28 Oct 13, 2026
e0e540e
fix(webview): refresh pinned views on non-activating saves; treat the…
easonliang28 Oct 13, 2026
74825b2
fix(webview): read the view overlay from the buffer, not the merged s…
easonliang28 Oct 13, 2026
08af5cb
fix(webview): rebuild active task handlers when a pinned profile is s…
easonliang28 Oct 13, 2026
ef73863
test: fix describe nesting, strengthen prune assertion, make stale-entry
easonliang28 Oct 13, 2026
6efdad3
fix: rebuild re-pinned siblings' tasks on profile deletion
easonLiangWorldedtech Oct 13, 2026
50aa367
fix(webview): scope profile-save task rebuilds to the task's own profile
easonliang28 Oct 13, 2026
66f5945
fix(webview): gate deleted-profile re-pin task writes on the task's o…
easonliang28 Oct 13, 2026
b68b049
Merge upstream main 58341d882 into vps2/f1b-getstate-merge
easonliang28 Oct 14, 2026
293ed16
fix: clear newly-unused bindings surfaced by main unused-vars re-enable
easonliang28 Oct 14, 2026
feaa45a
chore: drop Stryker suppression comments per AGENTS.md policy
easonliang28 Oct 14, 2026
9ebf99c
fix: snapshot sibling pinned-view overlays before shared provider-set…
easonliang28 Oct 14, 2026
e5fccc5
fix(f1b): compensate profile activation writes when a concurrent writ…
easonliang28 Oct 15, 2026
f35395b
fix(f1b): extend profile mutation compensation to the provider-manage…
easonliang28 Oct 16, 2026
eeb49d3
test(f1b): wait for the first queued activation deterministically
easonliang28 Oct 16, 2026
7ddb244
fix(f1b): confirm record absence with hasConfig before manager compen…
easonliang28 Oct 16, 2026
603a1a9
fix(f1b): keep view caches, pins, and profile creates consistent unde…
easonliang28 Oct 16, 2026
9fb15c5
fix(f1b): keep rename re-point typed and snapshot fields complete
easonliang28 Oct 16, 2026
298749d
fix: re-point closed-view pins on rename, undo half-finished renames,…
easonliang28 Oct 16, 2026
f2b5d22
fix: spend the create claim when the profile save itself fails
easonliang28 Oct 16, 2026
f0a6a91
fix(webview): hand the stored profile record to rename re-points and …
easonliang28 Oct 16, 2026
4451d9e
fix(webview): build activation writes from the stored record, roll ba…
easonliang28 Oct 17, 2026
61e4704
Merge upstream main into vps2/f1b-getstate-merge (row-9 refresh)
easonliang28 Oct 17, 2026
a528254
fix(webview): close rename compensation gaps and reject colliding tar…
easonliang28 Oct 17, 2026
837efba
fix(webview): harden activation rollback against in-flight races
easonliang28 Oct 17, 2026
33fc334
fix(webview): keep the queue owned through activation compensation
easonliang28 Oct 17, 2026
2003656
test(webview): cover the run-to-completion activation contract
easonliang28 Oct 17, 2026
88ba72d
fix(provider): skip timed-out queued mutations, spare cleared pins an…
easonliang28 Oct 17, 2026
691d9db
fix(provider): harden eviction checks and queue-settled test assertions
easonliang28 Oct 17, 2026
df62613
fix(provider): fail closed on unverified profile saves and compensate…
easonliang28 Oct 17, 2026
d772497
Merge remote-tracking branch 'upstream/main' into vps2/f1b-getstate-m…
easonLiangWorldedtech Oct 22, 2026
237561e
chore(knip): mark the test-only getPanel seam @internal
easonLiangWorldedtech Oct 22, 2026
a6aa4eb
fix(webview): keep the restored profile id and remove the unreachable…
easonLiangWorldedtech Oct 22, 2026
6390402
style: apply prettier formatting to the profile-restore changes
easonLiangWorldedtech Oct 22, 2026
49a0309
Merge upstream/main into vps2/f1b-getstate-merge
Nov 1, 2026
5f4ffdd
fix(merge): restore the upstream hunks dropped by the main merge
easonLiangWorldedtech Nov 1, 2026
1fe6912
chore: drop stray scratch file from the previous commit
easonLiangWorldedtech Nov 1, 2026
f129a95
merge upstream/main (a4f774b17) into vps2/f1b-getstate-merge
easonLiangWorldedtech Nov 2, 2026
debb003
fix(commands): drop the unused ExtensionMessage import
easonLiangWorldedtech Nov 2, 2026
f55700d
fix(merge): restore the postActions helper dropped by the upstream merge
easonLiangWorldedtech Nov 3, 2026
4f5538b
Merge upstream/main (3ee042d91) into vps2/f1b-getstate-merge
easonLiangWorldedtech Nov 3, 2026
b4013a6
fix(webview): reconcile profile overlays and harden the view-state wr…
easonLiangWorldedtech Nov 3, 2026
da2aeba
fix(webview): fail closed on unreadable profile records and stale tas…
easonLiangWorldedtech Nov 3, 2026
2b709a3
fix(webview): close the profile-deletion gaps around survivors, live …
easonLiangWorldedtech Nov 3, 2026
77c2bdb
fix(webview): keep rollbacks and resets from overwriting other views,…
easonLiangWorldedtech Nov 3, 2026
a1cbc34
fix(webview): keep a profile rollback from discarding another view's …
easonLiangWorldedtech Nov 3, 2026
9c0919e
fix(webview): point the shared selection at the renamed profile when …
easonLiangWorldedtech Nov 3, 2026
3a8bec2
fix(commands): let the API's new-tab creation bypass tracked-panel reuse
easonLiangWorldedtech Nov 3, 2026
71c69fe
test(extension): expect forceNew in the tab-factory contract
easonLiangWorldedtech Nov 3, 2026
8030dc0
fix(commands): focus the sidebar when plusButtonClicked runs without …
easonLiangWorldedtech Nov 3, 2026
ec59e85
fix(webview): report late profile commits, complete the activation ro…
easonLiangWorldedtech Nov 4, 2026
99b3e92
fix(webview): keep rename rollback paired, clear deleted modes from s…
easonLiangWorldedtech Nov 4, 2026
c6015f8
fix(commands): wait for the sidebar webview to resolve before posting…
easonLiangWorldedtech Nov 4, 2026
158c777
fix(webview): compare the stored settings before rename compensation …
easonLiangWorldedtech Nov 4, 2026
af37db3
fix(commands): state what the view-resolution wait actually releases on
easonLiangWorldedtech Nov 4, 2026
dba7c8f
fix(commands): keep a forced tab creation out of an in-flight ordinar…
easonLiangWorldedtech Nov 4, 2026
702a15d
fix(webview): read the shared selection after the deletion commits
easonLiangWorldedtech Nov 4, 2026
e64bebf
fix(webview): rebuild F1c on the rebuilt F1b + own delta
Oct 5, 2026
ab2fac0
test(webview): F2a - profile-mutation state semantics and the mode-ro…
Oct 5, 2026
add4d42
test(view-state): reject any shared mode write during history restora…
Oct 6, 2026
99c6426
test(view-state): read the recorded update calls through vi.mocked so…
Oct 6, 2026
6f0a13f
fix(mode-switch): make the mode switch a compensating transaction
Oct 7, 2026
fe84de6
fix(webview): satisfy the merged ClineProvider contract
Oct 7, 2026
9492713
chore(activate,webview): address review nits on the merged branch
Oct 7, 2026
19e69a0
fix(activate): drop the stale tab panel reference before replacing it
Oct 7, 2026
2f7d8ad
fix(webview): restore the view's own mode pin when a mode switch roll…
Oct 7, 2026
499a4d6
test(webview): keep the mode-switch task double type-compatible
Oct 7, 2026
cc3ca92
fix(webview): make profile deletion compensating and cover the cross-…
Oct 8, 2026
4b2d0b4
fix(config): keep the typed not-found error out of getProfile's wrapper
Oct 8, 2026
749b3ab
fix(provider): compensate every durable store when a profile or mode …
easonLiangWorldedtech Oct 8, 2026
68f8019
fix(webview): serialize profile deletion with the other profile mutat…
easonLiangWorldedtech Oct 8, 2026
f208277
fix(webview): roll back the shared write when the view-local write fails
easonLiangWorldedtech Oct 8, 2026
36127c6
test(webview): cover cross-view profile refresh and the sibling re-pi…
easonLiangWorldedtech Oct 8, 2026
957bca6
fix(activate): dispose a half-built tab when creation rejects
easonLiangWorldedtech Oct 8, 2026
f8e4bea
fix(webview): stop a cancelled profile deletion from writing durable …
easonLiangWorldedtech Oct 8, 2026
916c280
fix(webview): keep host-owned keys out of the generic updateSettings …
easonLiangWorldedtech Oct 8, 2026
ee2378d
fix(webview): finish provider disposal even when a teardown step rejects
easonLiangWorldedtech Oct 8, 2026
eeb737d
fix(webview): roll back the shared provider keys too, and clear the r…
easonLiangWorldedtech Oct 8, 2026
1df3724
test(webview): drive the public mode switch after a profile deletion
easonLiangWorldedtech Oct 8, 2026
34e91be
test(config): cover the id branch of the profile not-found error
easonLiangWorldedtech Oct 8, 2026
900f376
fix(webview): roll back every sibling view when one sibling's re-pin …
easonLiangWorldedtech Oct 8, 2026
045f9bc
test(webview): make the view-state persistence failure test fail on t…
easonLiangWorldedtech Oct 8, 2026
318f5e8
fix(webview): denylist currentApiConfigName and route profile deletio…
easonLiangWorldedtech Oct 9, 2026
48380aa
fix(webview): chain the profile-mutation queue to the running mutation
Oct 10, 2026
86295c8
fix(webview): stop touching a provider that has begun disposal
Oct 10, 2026
08ab760
style: apply the repository prettier formatting to the files the form…
easonLiangWorldedtech Oct 10, 2026
96c16f7
test(types): cover the persisted view-state record at the schema boun…
Oct 10, 2026
03e8558
fix(webview): compensate a profile deletion that the mutation timeout…
easonLiangWorldedtech Oct 10, 2026
1d01564
fix(webview): keep a concurrent profile upsert when a deletion rolls …
easonLiangWorldedtech Oct 10, 2026
f52ec42
fix(webview): compensate every durable write when a profile upsert or…
Oct 11, 2026
03701e6
fix(webview): compensate a profile upsert the timeout cancels after t…
Oct 11, 2026
6850e6f
fix(webview): finish the activation when deleting the active profile
easonliang28 Oct 12, 2026
ef46a84
fix(webview): distinguish post-commit activation failure from deletio…
easonliang28 Oct 13, 2026
4b6e818
chore(ci): re-trigger checks after flaky extension-host-visual lane
easonliang28 Oct 13, 2026
55eda58
chore(ci): re-trigger checks after second flaky e2e-mock timeout
easonliang28 Oct 13, 2026
a248f65
fix: serialize profile mutations across views and keep sibling tasks …
easonliang28 Oct 13, 2026
5d65266
fix(webview): scope profile-save task rebuilds to the task's own profile
easonliang28 Oct 13, 2026
7298090
fix(webview): gate deleted-profile re-pin task writes on the task's o…
easonliang28 Oct 13, 2026
7e5fafd
fix: clear newly-unused bindings surfaced by main unused-vars re-enable
easonliang28 Oct 14, 2026
40ad776
chore: drop Stryker suppression comments per AGENTS.md policy
easonliang28 Oct 14, 2026
69b7842
test: await serialized view-state writes and global-state seeds deter…
easonliang28 Oct 14, 2026
9d5a828
test: complete the activation snapshot reads in the activation-buffer…
easonliang28 Oct 15, 2026
17a5ef5
fix: broadcast reset across live providers and correct the stale per-…
easonliang28 Oct 15, 2026
eead56d
fix(f2a): surface sibling restore failures from deletion compensation
easonliang28 Oct 16, 2026
23100ed
chore: retrigger CI (workflow trigger missed)
easonliang28 Oct 16, 2026
0937f9f
fix(f2a): defer sibling task-handler rebuilds and keep view caches co…
easonliang28 Oct 16, 2026
8125072
fix: re-point closed-view pins on rename, undo half-finished renames,…
easonliang28 Oct 16, 2026
fe16356
chore: drop husky-generated LFS hook scripts under .husky/_ (regenera…
easonliang28 Oct 16, 2026
e84e084
fix(webview): hand the stored profile record to rename re-points, rol…
easonliang28 Oct 16, 2026
a6d23c0
fix(webview): build activation writes from the stored record, roll ba…
easonliang28 Oct 17, 2026
e2635c9
fix(webview): order the durable re-point before the live re-pin
easonliang28 Oct 17, 2026
40cc12b
fix(provider): fail closed on unverified profile saves and compensate…
easonliang28 Oct 17, 2026
5ac3678
fix(provider): keep committed deletions committed and compensate once
easonliang28 Oct 17, 2026
4c17ff9
style: apply repo Prettier to the merge resolution
easonLiangWorldedtech Oct 22, 2026
7942629
fix(webview): merge-restore the view pins and keep committed deletion…
easonLiangWorldedtech Oct 22, 2026
1671703
style: apply prettier formatting to the deletion-compensation changes
easonLiangWorldedtech Oct 22, 2026
5ca3ba0
fix(webview): address review findings on view-state keys and deletion…
easonLiangWorldedtech Oct 30, 2026
a65dcae
fix(webview): keep profile name and configuration consistent
easonLiangWorldedtech Oct 30, 2026
96c3855
fix(webview): address the F2a review findings (batch 1)
easonLiangWorldedtech Oct 30, 2026
958738e
fix(webview): address the F2a review findings (batch 2)
easonLiangWorldedtech Oct 30, 2026
b38bc77
fix(merge): restore the upstream hunks dropped by the main merge
easonLiangWorldedtech Nov 1, 2026
5be37f9
test(e2e): wait for the task to reach history before the restart veri…
easonLiangWorldedtech Nov 2, 2026
90d7e23
fix(core/webview): never inherit an orphaned pre-launch viewStates entry
easonLiangWorldedtech Nov 3, 2026
2b78457
fix(webview): keep flat provider-profile keys out of the updateSettin…
easonLiangWorldedtech Nov 3, 2026
1ab5e4a
fix(core/webview): order the profile-mutation majors so compensation …
easonLiangWorldedtech Nov 3, 2026
d9e3665
test(core/webview): prove the last-profile refusal leaves the stored …
easonLiangWorldedtech Nov 3, 2026
9aeafc7
fix(core/webview): restore each sibling's sticky profile independently
easonLiangWorldedtech Nov 3, 2026
3100a8b
fix(core/webview): pin the deletion snapshot's task when rebuilding s…
easonLiangWorldedtech Nov 3, 2026
060fc76
fix(webview): post the merged state after the launch pin repair
easonLiangWorldedtech Nov 3, 2026
6362b46
fix(webview): surface a failed rename compensation instead of only lo…
easonLiangWorldedtech Nov 3, 2026
8b4b2ae
fix(webview): fence resetState against profile mutations still in flight
easonLiangWorldedtech Nov 3, 2026
68f4cf7
fix(webview): carry the landed F1b profile contract into the F2a unit
easonLiangWorldedtech Nov 4, 2026
2172fcd
fix(core,webview): settle the four review findings on the view-state …
easonLiangWorldedtech Nov 4, 2026
c2206c5
fix(core,webview): confirm the newest resolved write and restore the …
easonLiangWorldedtech Nov 5, 2026
4d002c4
test(config,webview): cover storage failures and the sibling view's s…
easonliang28 Nov 5, 2026
1c1ac88
Merge upstream/main (e943530c8) into vps2-f2a
easonliang28 Nov 5, 2026
da74128
test(activate): scope the throwing MdmService mock to the fallback test
easonLiangWorldedtech Nov 5, 2026
244a210
test(core/config): make the two restore-spec cases differ by write order
easonLiangWorldedtech Nov 5, 2026
2e19e38
fix(webview): run profile deletion inside the provider profile mutati…
easonLiangWorldedtech Nov 5, 2026
ec318b3
fix(webview): move the sibling task-handler rebuild out of the settle…
easonLiangWorldedtech Nov 5, 2026
186355a
fix(webview): put the acting view own pin back and order its sticky w…
easonLiangWorldedtech Nov 5, 2026
42b4b6f
fix(webview): keep the reset going when a sibling webview refuses the…
easonLiangWorldedtech Nov 5, 2026
0579f8d
fix(webview): warn when a rename activation rollback cannot restore t…
easonLiangWorldedtech Nov 5, 2026
2b7a41d
fix(webview): keep the shared store paired with the selection when a …
easonLiangWorldedtech Nov 5, 2026
bc729fc
fix(activate): keep a live tab panel tracked when the tracked one closes
easonLiangWorldedtech Nov 5, 2026
4719931
fix(webview): keep a committed deletion and a live tab panel across f…
easonLiangWorldedtech Nov 5, 2026
987a4ff
fix(webview): take the profile delete off the manager lookup and tigh…
easonLiangWorldedtech Nov 5, 2026
8559e8b
test(webview): restore the provider double after the stale-profile de…
easonLiangWorldedtech Nov 5, 2026
94b624c
test(vps2-f2a): cover the launched view and share the settings key lists
easonLiangWorldedtech Nov 5, 2026
05aa4e1
test(vps2-f2a): read the preserved profile back by value
easonLiangWorldedtech Nov 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/vscode-e2e/src/suite/restart-persistence.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ async function runCreate(api: RooCodeAPI): Promise<void> {
const createdTaskId: string = taskId
await waitFor(() => api.hasTaskUiMessageText(createdTaskId, MARKER))

// history_item.json is written outside the ui_messages.json flush as well: wait for
// the task to be visible in history before quitting, or the verify phase can assert
// on a task that only ever existed in memory.
await waitFor(() => api.isTaskInHistory(createdTaskId))

const result: PhaseResult = {
version: PHASE_RESULT_VERSION,
phase: "create",
Expand Down
67 changes: 67 additions & 0 deletions packages/types/src/__tests__/global-settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
DEFAULT_DESTRUCTIVE_COMMAND_GUARD_ENABLED,
GLOBAL_SETTINGS_KEYS,
globalSettingsSchema,
viewStateSchema,
} from "../global-settings.js"

describe("destructive command guard global setting", () => {
Expand Down Expand Up @@ -51,3 +52,69 @@ describe("collapseCommandOutputByDefault global setting", () => {
expect(globalSettingsSchema.safeParse({ collapseCommandOutputByDefault: "true" }).success).toBe(false)
})
})

describe("viewStates global setting", () => {
it("preserves each webview instance selection through the persisted schema", () => {
const parsed = globalSettingsSchema.parse({
viewStates: {
"session-1": { mode: "code", currentApiConfigName: "default", updatedAt: 1700000000000 },
"session-2": { mode: "architect" },
},
})
// Every field has to survive the round trip: a selection the schema drops is
// written back as absent, so the next window opens in the default mode.
expect(parsed.viewStates).toEqual({
"session-1": { mode: "code", currentApiConfigName: "default", updatedAt: 1700000000000 },
"session-2": { mode: "architect" },
})
})

it("parses a single view state on its own", () => {
expect(viewStateSchema.parse({ mode: "ask", currentApiConfigName: "x", updatedAt: 5 })).toEqual({
mode: "ask",
currentApiConfigName: "x",
updatedAt: 5,
})
})

it("rejects a numeric mode and names the offending path", () => {
// The control first: the same record without the bad field must parse, so a
// failure here can only mean the schema rejected that value - not that the record
// shape is unsupported or the assertion never ran.
expect(globalSettingsSchema.safeParse({ viewStates: { a: { mode: "code" } } }).success).toBe(true)

const result = globalSettingsSchema.safeParse({ viewStates: { a: { mode: 42 } } })

expect(result.success).toBe(false)
expect(result.error?.issues[0]?.path).toEqual(["viewStates", "a", "mode"])
})

it("rejects a non-string currentApiConfigName and names the offending path", () => {
expect(globalSettingsSchema.safeParse({ viewStates: { a: { currentApiConfigName: "x" } } }).success).toBe(true)

const result = globalSettingsSchema.safeParse({ viewStates: { a: { currentApiConfigName: 7 } } })

expect(result.success).toBe(false)
expect(result.error?.issues[0]?.path).toEqual(["viewStates", "a", "currentApiConfigName"])
})

it("rejects a non-numeric updatedAt and names the offending path", () => {
expect(globalSettingsSchema.safeParse({ viewStates: { a: { updatedAt: 1 } } }).success).toBe(true)

const result = globalSettingsSchema.safeParse({ viewStates: { a: { updatedAt: "1" } } })

expect(result.success).toBe(false)
expect(result.error?.issues[0]?.path).toEqual(["viewStates", "a", "updatedAt"])
})

it("rejects a view state that is not an object", () => {
// A bare string under a session id is what a half-migrated store looks like;
// accepting it defers the crash to whoever reads the selection back.
expect(globalSettingsSchema.safeParse({ viewStates: { a: { mode: "code" } } }).success).toBe(true)

const result = globalSettingsSchema.safeParse({ viewStates: { a: "code" } })

expect(result.success).toBe(false)
expect(result.error?.issues[0]?.path).toEqual(["viewStates", "a"])
})
})
5 changes: 5 additions & 0 deletions packages/types/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import { GLOBAL_STATE_KEYS } from "../index.js"

describe("GLOBAL_STATE_KEYS", () => {
it("should contain registered durable per-view state", () => {
expect(GLOBAL_STATE_KEYS).toContain("viewStates")
})

it("should contain provider settings keys", () => {
expect(GLOBAL_STATE_KEYS).toContain("autoApprovalEnabled")
})
Expand All @@ -13,6 +17,7 @@ describe("GLOBAL_STATE_KEYS", () => {

it("should not contain secret state keys", () => {
expect(GLOBAL_STATE_KEYS).not.toContain("openRouterApiKey")
expect(GLOBAL_STATE_KEYS).not.toContain("apiKey")
})

it("should contain OpenAI Compatible base URL setting", () => {
Expand Down
10 changes: 10 additions & 0 deletions packages/types/src/global-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ export const MAX_CHECKPOINT_TIMEOUT_SECONDS = 60
*/
export const DEFAULT_CHECKPOINT_TIMEOUT_SECONDS = 15

/**
* Persisted non-secret selections for a stable webview instance.
*/
export const viewStateSchema = z.object({
mode: z.string().optional(),
currentApiConfigName: z.string().optional(),
updatedAt: z.number().optional(),
})

/**
* GlobalSettings
*/
Expand All @@ -122,6 +131,7 @@ export const globalSettingsSchema = z.object({
currentApiConfigName: z.string().optional(),
listApiConfigMeta: z.array(providerSettingsEntrySchema).optional(),
pinnedApiConfigs: z.record(z.string(), z.boolean()).optional(),
viewStates: z.record(z.string(), viewStateSchema).optional(),

lastShownAnnouncementId: z.string().optional(),
customInstructions: z.string().optional(),
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/vscode-extension-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ export interface WebviewMessage {
| "themeFixtureProbeResponse"
| "diagnosticsResponse"
text?: string
viewStateId?: string
taskId?: string
editedMessageContent?: string
tab?: "settings" | "history" | "mcp" | "modes" | "chat" | "marketplace" | "cloud"
Expand Down
8 changes: 8 additions & 0 deletions packages/types/src/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ export const commandIds = [
"popoutButtonClicked",
"settingsButtonClicked",

// Editor-tab (popped-out) surface variants of the title-bar buttons. The
// shared ids above target the sidebar click origin, so the tab surface
// needs its own ids (see registerCommands.ts getTabProvider).
"plusButtonClickedInTab",
"settingsButtonClickedInTab",
"marketplaceButtonClickedInTab",
"historyButtonClickedInTab",

"openInNewTab",

"newTask",
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ describe("extension.ts", () => {
context: mockContext,
outputChannel,
webviewFocusTracker: tracker,
forceNew: true,
})
tracker?.dispose()
})
Expand Down
Loading
Loading