Skip to content

feat(agents): grant session-history tool to compaction-enabled agents#879

Merged
dobesv merged 1 commit into
mainfrom
feat/compaction-agents-session-history-tool
Jun 19, 2026
Merged

feat(agents): grant session-history tool to compaction-enabled agents#879
dobesv merged 1 commit into
mainfrom
feat/compaction-agents-session-history-tool

Conversation

@dobesv

@dobesv dobesv commented Jun 18, 2026

Copy link
Copy Markdown
Owner

What

Adds harnx_agent_session_history_read to the use_tools list of every bundled agent that has a compaction_agent configured (36 agents across example_config, packages/coding, and packages/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 (see config/mod.rs and the session_history_tool_declaration_is_gated_by_use_tools test).

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

  • Targeted agents are those with a compaction_agent: field — i.e. agents that get compacted.
  • role: compaction summarizer agents and shared/ prompt fragments are intentionally excluded; they don't need to search their own history.
  • The tool is inserted as the last use_tools entry in each file, matching each file's existing indentation.

Verification

  • YAML frontmatter re-parses for all 36 files, with the tool present in use_tools.
  • No bundled compaction agent is left without the tool.
  • cargo nextest -p harnx-runtime agent/config/compaction-loading tests: 62 passed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Agents configured with compaction can now access their pre-compaction session history after a compaction event, enabling better continuity in agent operations.
  • Chores

    • Updated multiple agent configurations to enable the new session history reading capability.

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>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a701d6c-31a4-41e4-9ad8-fc8bf39aeee6

📥 Commits

Reviewing files that changed from the base of the PR and between 43d57fc and 1f95c35.

📒 Files selected for processing (37)
  • .changeset/compaction-agents-session-history-tool.md
  • example_config/agents/example-agent.md
  • packages/coding/agents/coder.md
  • packages/pantheon/agents/aeacus.md
  • packages/pantheon/agents/apollo.md
  • packages/pantheon/agents/argus.md
  • packages/pantheon/agents/aristarchus.md
  • packages/pantheon/agents/athena.md
  • packages/pantheon/agents/atlas.md
  • packages/pantheon/agents/calliope.md
  • packages/pantheon/agents/clio.md
  • packages/pantheon/agents/daedalus.md
  • packages/pantheon/agents/erato.md
  • packages/pantheon/agents/euterpe.md
  • packages/pantheon/agents/hephaestus.md
  • packages/pantheon/agents/hermes.md
  • packages/pantheon/agents/hestia.md
  • packages/pantheon/agents/iris.md
  • packages/pantheon/agents/librarian.md
  • packages/pantheon/agents/melpomene.md
  • packages/pantheon/agents/metis.md
  • packages/pantheon/agents/minos.md
  • packages/pantheon/agents/mnemosyne.md
  • packages/pantheon/agents/momus.md
  • packages/pantheon/agents/nemesis.md
  • packages/pantheon/agents/oracle.md
  • packages/pantheon/agents/peitho.md
  • packages/pantheon/agents/plato.md
  • packages/pantheon/agents/polyhymnia.md
  • packages/pantheon/agents/pytheas.md
  • packages/pantheon/agents/rhadamanthus.md
  • packages/pantheon/agents/sisyphus.md
  • packages/pantheon/agents/terpsichore.md
  • packages/pantheon/agents/thalia.md
  • packages/pantheon/agents/tyche.md
  • packages/pantheon/agents/urania.md
  • packages/pantheon/agents/zosimus.md

📝 Walkthrough

Walkthrough

A new changeset records patch bumps for harnx, pantheon, and coding. The harnx_agent_session_history_read tool is added to the use_tools list of 35 bundled agent configuration files across example_config, packages/coding, and packages/pantheon. It is simultaneously removed from pytheas.md and rhadamanthus.md.

Changes

Session History Tool Grant to Bundled Agents

Layer / File(s) Summary
Changeset documentation
.changeset/compaction-agents-session-history-tool.md
Records patch version bumps for harnx, pantheon, and coding, and documents that harnx_agent_session_history_read is granted to agents configured with a compaction_agent.
Agent use_tools additions and removals
example_config/agents/example-agent.md, packages/coding/agents/coder.md, packages/pantheon/agents/*.md
Adds harnx_agent_session_history_read to the use_tools frontmatter of 35 agent configs; removes it from pytheas.md and rhadamanthus.md.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • dobesv/harnx#288: Enables the compaction_agent flow that this PR builds on — this PR grants the harnx_agent_session_history_read tool to agents that use compaction_agent so they can query pre-compaction session history.

Poem

🐇 Hippity-hop through the agent files so wide,
A new tool was added on every inside!
session_history_read — now bundled with care,
For agents with compaction, the history's right there.
Two exceptions were pruned with a snip and a snap,
Then the changeset was sealed with a bunny-eared clap! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(agents): grant session-history tool to compaction-enabled agents' clearly and accurately summarizes the primary change: granting the session-history tool to agents with compaction enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/compaction-agents-session-history-tool

Comment @coderabbitai help to get the list of available commands and usage tips.

@dobesv dobesv merged commit 3a99385 into main Jun 19, 2026
8 checks passed
@dobesv dobesv deleted the feat/compaction-agents-session-history-tool branch June 19, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant