feat(agent): budget reminders, usage while waiting, budget-exceeded status and dedupe

- tool results carry a budget reminder near limits; text before the last tool
  call is dropped as report when cut by budget/abort
- usage persisted when a run suspends, so waiting sessions show spent tokens
- task page shows budget_exceeded via business.outcome instead of completed
- budget-exceeded decisions merge by root cause (decision / schedule / goal
  template); new summaries added to investigate allowlist

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 01:58:28 +08:00
1 parent 4cd9ec8390
commit a00a9eaf5d
14 files changed
+205 -21

No files matched your search

+3 -1
View File
@@ -202,8 +202,10 @@ function toolResults(messages: Message[]): FakeToolResult[] {
if (m.role !== "toolResult") continue;
const text = messageText(m);
let json: unknown;
// 第一块文本是能力输出;运行时可能在后面追加【预算提醒】等附注块
const first = (m.content as Array<{ type: string; text?: string }>).find((c) => c.type === "text")?.text ?? text;
try {
json = JSON.parse(text);
json = JSON.parse(first);
} catch {
json = undefined;
}