feat(agents): grant session-history tool to compaction-enabled agents#879
Conversation
Add `harnx_agent_session_history_read` to the `use_tools` of every bundled agent that has a `compaction_agent` configured. After a compaction these agents can now search their own pre-compaction session history (issue #819, tool added in #851) to recover any context dropped during summarization. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (37)
📝 WalkthroughWalkthroughA new changeset records patch bumps for ChangesSession History Tool Grant to Bundled Agents
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What
Adds
harnx_agent_session_history_readto theuse_toolslist of every bundled agent that has acompaction_agentconfigured (36 agents acrossexample_config,packages/coding, andpackages/pantheon).Why
The session-history search tool (issue #819, implemented in #851) lets an agent grep its own pre-compaction session transcript to recover context that summarization may have dropped. But the tool is gated by
use_tools— it's only offered to an agent that lists it explicitly or uses a*wildcard (seeconfig/mod.rsand thesession_history_tool_declaration_is_gated_by_use_toolstest).None of the bundled compaction-enabled agents used a wildcard, so the tool the compaction flow points them at (
session_ops_split.rs) was never actually callable. This grants it to exactly the agents that undergo compaction.Scope
compaction_agent:field — i.e. agents that get compacted.role: compactionsummarizer agents andshared/prompt fragments are intentionally excluded; they don't need to search their own history.use_toolsentry in each file, matching each file's existing indentation.Verification
use_tools.cargo nextest -p harnx-runtimeagent/config/compaction-loading tests: 62 passed.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores