fix: require explicit system event session keys

This commit is contained in:
Peter Steinberger
2026-01-09 21:58:55 +01:00
parent cb2a365594
commit 42a0089b3b
14 changed files with 123 additions and 53 deletions

View File

@@ -14,6 +14,7 @@ const mocks = vi.hoisted(() => ({
systemSent: true,
},
}),
resolveMainSessionKey: vi.fn().mockReturnValue("agent:main:main"),
resolveStorePath: vi.fn().mockReturnValue("/tmp/sessions.json"),
webAuthExists: vi.fn().mockResolvedValue(true),
getWebAuthAgeMs: vi.fn().mockReturnValue(5000),
@@ -23,6 +24,7 @@ const mocks = vi.hoisted(() => ({
vi.mock("../config/sessions.js", () => ({
loadSessionStore: mocks.loadSessionStore,
resolveMainSessionKey: mocks.resolveMainSessionKey,
resolveStorePath: mocks.resolveStorePath,
}));
vi.mock("../web/session.js", () => ({

View File

@@ -9,6 +9,7 @@ import { withProgress } from "../cli/progress.js";
import { loadConfig, resolveGatewayPort } from "../config/config.js";
import {
loadSessionStore,
resolveMainSessionKey,
resolveStorePath,
type SessionEntry,
} from "../config/sessions.js";
@@ -77,7 +78,8 @@ export async function getStatusSummary(): Promise<StatusSummary> {
colorize: true,
includeAllowFrom: true,
});
const queuedSystemEvents = peekSystemEvents();
const mainSessionKey = resolveMainSessionKey(cfg);
const queuedSystemEvents = peekSystemEvents(mainSessionKey);
const resolved = resolveConfiguredModelRef({
cfg,