Tighten agent token brief stop gate · Entire
Tighten agent token brief stop gate
0be9bbe·
peyton-alt·3w ago·2 files·+6 added/-2 removed
Sessions
1051aa7485b2View transcript
Changes
2
cmd/entire/cli
Msession_tokens.go+1/-1
Msessions_test.go+5/-1
518 unmodified lines
519
520
521
522
522
523
524
525
518 unmodified lines
case hasTokenRecommendation(report, "api-call-amplification"):
return agentBriefCostProxyBatchAction, true
case hasTokenRecommendation(report, "context-replay-hotspot"):
return "Use at most 2 focused reads after summarizing known findings, then answer. Avoid broad grep, broad diffs, and broad tests.", true
return "Use at most 2 focused reads only if a named file or test can change the answer; otherwise answer now. Avoid broad grep, broad diffs, and broad tests.", true
case hasTokenRecommendation(report, "subagent-heavy"):
return "Do not launch broad subagents. Use one narrowly scoped check with a concrete expected output.", true
case hasTokenRecommendation(report, "high-context-pressure"):
Mcmd/entire/cli/session_tokens.go+1/-1
1298 unmodified lines
1299
1300
1301
1302
1303
1304
1305
43 unmodified lines
1349
1350
1351
1351
1352
1353
1354
1355
113 unmodified lines
1469
1470
1471
1472
1473
1474
1475
29 unmodified lines
1505
1506
1507
1508
1509
1510
1511
404 unmodified lines
1916
1917
1918
1919
1920
1921
1922
1298 unmodified lines
"Token usage: 6213.6k total; 97.4% cache/context replay; 70 API calls.",
"Next best action:",
"Use at most 3 batched reads before answering.",
"Continue only if a named file or test can change the verdict; otherwise answer now.",
"Avoid broad grep, broad diffs, broad tests, and repeated token diagnostics; keep the answer tight.",
"Signals:",
"- Cache/context replay dominates token volume."
43 unmodified lines
out := stdout.String()
checks := []string{
"Token usage: 637.7k total; 95.5% cache/context replay; 3 API calls.",
"Use at most 2 focused reads after summarizing known findings, then answer.",
"Use at most 2 focused reads only if a named file or test can change the answer; otherwise answer now.",
"Avoid broad grep, broad diffs, and broad tests.",
"- Cache/context replay dominates token volume.",
}
113 unmodified lines
"Session: test-cost-proxy-brief",
"Use at most 3 batched reads",
"Avoid broad grep, broad diffs, broad tests",
"otherwise answer now",
"keep the answer tight",
"- Cache write/new context pressure is elevated.",
"- Output pressure is elevated."
29 unmodified lines
"Checkpoint: c05e500cafe0",
"Use at most 3 batched reads",
"Avoid broad grep, broad diffs, broad tests",
"otherwise answer now",
"keep the answer tight",
"- Cache write/new context pressure is elevated.",
"- Output pressure is elevated."
404 unmodified lines