From 5c7d6f55c2f4aeea8a726dfe54f6a0335a0fe7d3 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Apr 2026 04:02:48 +0100 Subject: [PATCH] fix(status): refresh typed status test fixtures --- .../status.command-report-data.test.ts | 1 + src/commands/status.test-support.ts | 62 +++++++++++++++++-- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/src/commands/status.command-report-data.test.ts b/src/commands/status.command-report-data.test.ts index 43545bbd0ed..afb4d724a81 100644 --- a/src/commands/status.command-report-data.test.ts +++ b/src/commands/status.command-report-data.test.ts @@ -17,6 +17,7 @@ describe("buildStatusCommandReportData", () => { ...baseParams.summary.sessions, recent: [ { + ...baseParams.summary.sessions.recent[0], key: "session-key", kind: "direct", updatedAt: 1, diff --git a/src/commands/status.test-support.ts b/src/commands/status.test-support.ts index 9d629fe2a77..3579b354ff9 100644 --- a/src/commands/status.test-support.ts +++ b/src/commands/status.test-support.ts @@ -93,7 +93,21 @@ export const baseStatusSummary = { count: 2, paths: ["store.json"], defaults: { model: "gpt-5.4", contextTokens: 12_000 }, - recent: [{ key: "session-key", kind: "direct", updatedAt: 1, age: 5_000, model: "gpt-5.4" }], + recent: [ + { + key: "session-key", + kind: "direct", + updatedAt: 1, + age: 5_000, + model: "gpt-5.4", + totalTokens: 12_000, + totalTokensFresh: true, + remainingTokens: 4_000, + percentUsed: 75, + contextTokens: 16_000, + flags: [], + }, + ], byAgent: [], }, } as unknown as StatusSummary; @@ -126,7 +140,7 @@ export const baseStatusPluginCompatibility = [ export function createStatusLastHeartbeat(): HeartbeatEventPayload { return { ts: Date.now() - 30_000, - status: "ok", + status: "ok-token", channel: "discord", accountId: "acct", }; @@ -172,7 +186,22 @@ export function createStatusCommandOverviewRowsParams( surface: baseStatusOverviewSurface, osLabel: "macOS", summary: baseStatusSummary, - health: { durationMs: 42 }, + health: { + ok: true, + ts: Date.now(), + durationMs: 42, + channels: {}, + channelOrder: [], + channelLabels: {}, + heartbeatSeconds: 60, + defaultAgentId: "main", + agents: [], + sessions: { + path: "store.json", + count: 2, + recent: [{ key: "session-key", updatedAt: 1, age: 5_000 }], + }, + }, lastHeartbeat: createStatusLastHeartbeat(), agentStatus: baseStatusAgentStatus, memory: baseStatusMemory, @@ -195,10 +224,33 @@ export function createStatusCommandReportDataParams( osSummary: { label: "macOS" } as never, summary: baseStatusSummary, securityAudit: { + ts: Date.now(), summary: { critical: 0, warn: 1, info: 0 }, - findings: [{ severity: "warn", title: "Warn first", detail: "warn detail" }], + findings: [ + { + checkId: "warn-first", + severity: "warn", + title: "Warn first", + detail: "warn detail", + }, + ], + }, + health: { + ok: true, + ts: Date.now(), + durationMs: 42, + channels: {}, + channelOrder: [], + channelLabels: {}, + heartbeatSeconds: 60, + defaultAgentId: "main", + agents: [], + sessions: { + path: "store.json", + count: 2, + recent: [{ key: "session-key", updatedAt: 1, age: 5_000 }], + }, }, - health: { durationMs: 42 }, usageLines: ["usage line"], lastHeartbeat: createStatusLastHeartbeat(), agentStatus: baseStatusAgentStatus,