fix(ui): include unloaded global session alias

This commit is contained in:
FullerStackDev
2026-07-07 00:37:03 -06:00
parent ee1ff70de4
commit 32a33eb4cd
2 changed files with 33 additions and 0 deletions
+30
View File
@@ -401,6 +401,36 @@ describe("reconcileChatRunFromCurrentSessionRow stale-active suppression (#87875
);
});
it("publishes the canonical global key before the local session list loads", () => {
const reconcileRunTerminal = vi.fn();
const host = makeHost({
sessionKey: "agent:work:main",
chatRunId: "run-global",
chatStream: "streaming",
sessionsResult: null,
sessions: {
reconcileRunTerminal,
setModelOverride: vi.fn(),
},
});
reconcileChatRunLifecycle(host, {
outcome: "done",
sessionStatus: "done",
runId: "run-global",
sessionKey: "agent:work:main",
clearLocalRun: true,
clearChatStream: true,
});
expect(reconcileRunTerminal).toHaveBeenCalledWith(
expect.objectContaining({
runId: "run-global",
sessionKeys: expect.arrayContaining(["agent:work:main", "global"]),
}),
);
});
it("arms suppression on a completed turn, then suppresses the racing refresh", () => {
const host = makeHost({
chatRunId: "r1",
+3
View File
@@ -229,6 +229,9 @@ function sessionKeysFor(host: RunLifecycleHost, options: ReconcileOptions): Set<
if (primary) {
keys.add(primary);
}
if (uiSessionRowMatchesSelectedChat(host, "global", primary)) {
keys.add("global");
}
for (const row of host.sessionsResult?.sessions ?? []) {
if (uiSessionRowMatchesSelectedChat(host, row.key, primary)) {
keys.add(row.key);