mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(ui): include unloaded global session alias
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user