feat: show transcript file size in session status

Add transcript size monitoring to /status and session_status tool.
Displays file size and message count (e.g. '📄 Transcript: 1.2 MB,
627 messages'). Shows ⚠️ warning when transcript exceeds 1 MB, which
helps catch sessions approaching the compaction death spiral described
in #13624.

- getTranscriptInfo() reads JSONL file stat + line count
- Wired into both /status command and session_status tool
- 8 new tests covering file reading, formatting, and edge cases
This commit is contained in:
Hubert
2026-02-16 21:27:14 +00:00
committed by Peter Steinberger
parent fc6d53c895
commit 15dd2cda20
4 changed files with 208 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ import {
resolveUsageProviderId,
} from "../../infra/provider-usage.js";
import { normalizeGroupActivation } from "../group-activation.js";
import { buildStatusMessage } from "../status.js";
import { buildStatusMessage, getTranscriptInfo } from "../status.js";
import { getFollowupQueueDepth, resolveQueueSettings } from "./queue.js";
import { resolveSubagentLabel } from "./subagents-utils.js";
@@ -247,6 +247,13 @@ export async function buildStatusReply(params: {
subagentsLine,
mediaDecisions: params.mediaDecisions,
includeTranscriptUsage: false,
transcriptInfo: getTranscriptInfo({
sessionId: sessionEntry?.sessionId,
sessionEntry,
agentId: statusAgentId,
sessionKey,
storePath,
}),
});
return { text: statusText };