#13792: Claude/openclaw token efficiency q ni2s
agents
stale
Cluster:
Memory Management Enhancements
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR introduces several token-efficiency features for the agent runtime: compaction profiles and proactive compaction thresholds, isolated heartbeat prompts, default memory-flush behavior, rule-based model routing, Anthropic prompt caching breakpoints, a token-efficient-tools beta header wrapper, and tool-output pruning utilities.
The changes are mostly additive and covered by new unit tests, and they’re wired into the embedded runner via new streamFn wrappers. The main blockers are around integration correctness: the embedded runner currently imports prompt-caching/token-efficient-tools from paths that don’t appear to exist in the repo, and the tool-output pruning placeholder references a tool name that doesn’t exist, so the “retrieve full output” instruction can’t be followed.
<h3>Confidence Score: 2/5</h3>
- Not safe to merge until import/path and recovery-instruction issues are fixed.
- Two issues are likely to break functionality: (1) the embedded runner imports new modules from paths that don’t exist in this repo, which should break module resolution at build/runtime; (2) tool-output pruning tells users to use a non-existent tool name to recover pruned output. The rest of the changes are additive and unit-tested.
- src/agents/pi-embedded-runner/run/attempt.ts, src/agents/tool-output-pruning.ts
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#12425: feat(core): Native Token Optimization Defaults (Pruning, Compaction...
by oneles · 2026-02-09
82.4%
#8919: Pr/memory flush improvements
by shortbus · 2026-02-04
79.9%
#15852: fix: pass agentId when resolving IRC session paths
by MisterGuy420 · 2026-02-14
79.0%
#8961: feat: smarter compaction tool truncation + token count in system pr...
by SocialNerd42069 · 2026-02-04
78.8%
#10676: Claude/authorize external access lbcnb
by zacharyjleach-stack · 2026-02-06
78.4%
#14701: Agent: enforce execute-first replies and clarify whisper modes
by Swader · 2026-02-12
78.3%
#6512: Claude/setup open claw agent f v sqk
by franelcisco · 2026-02-01
78.1%
#7892: Claude/setup agent firewall ww xsv
by starwreckntx · 2026-02-03
77.8%
#9012: fix(memory): resilient flush for large sessions [AI-assisted]
by cheenu1092-oss · 2026-02-04
77.0%
#14136: feat: add agent collapse safeguards and fix TUI display on abort
by liangweigain-create · 2026-02-11
76.6%