fix(cso): count remainingSeconds to the investigation deadline; bound and validate the tool timeline

remainingSeconds now measures to deadline - 60s, the point where scan,
verify and record-review refuse with DEADLINE, and inspect carries it.
The post-command clock lookup can only omit the field, never fail a
command whose state change is already saved. The stream timeline records
end times from tool_result, indexes only recorded calls so it stays at
the 4096 cap, and receipts reject malformed timeline entries.
This commit is contained in:
garrytan committed 2026-10-17 05:37:17 +00:00
1 parent 6a432f00a0
commit d804fbb2fc
11 files changed
+90 -34

No files matched your search

+1 -1
View File
@@ -131,7 +131,7 @@ export interface ProducerReceipt {
firstUsefulResultMs: null;
toolCalls: number;
/** Content-free tool timeline (name, offset, thread) for diagnosing overruns; absent when the adapter has none. */
toolTimeline?: Array<{ atMs: number; tool: string; agent: 'main' | 'subagent' }>;
toolTimeline?: Array<{ atMs: number; endMs?: number; tool: string; agent: 'main' | 'subagent' }>;
output: string;
outputHash: string;
usage: {