Merge #777: auto-compact and auto-clear from the statusLine context size

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-11-11 20:18:51 +01:00
commit 6fa2dfa549
16 files changed
+579 -45

No files matched your search

@@ -65,6 +65,13 @@ export function registerStatusTelemetryRoutes(app: FastifyInstance, ctx: Session
session.noteReportedModel('statusline', payload?.model?.display_name);
}
// The context size drives auto-compact and auto-clear. A render without one (the exporter
// can post before the first API response) keeps the last report instead of wiping it.
const status = reportsStatusLine ? parseSessionStatus(payload) : null;
if (session && status?.inputTokens !== undefined) {
session.noteContextReport({ tokens: status.inputTokens, windowSize: status.contextWindowSize });
}
// Prompt-cache state of the main conversation (Claude Code v2.1.251+): kept on the
// session for the Session Options readout and `toState()`, broadcast only when the
// report changes (the statusline fires on every assistant message). The broadcast