Skip to content

fix(tool-activation): restore tools an unload left off before a compaction checkpoint - #3200

Merged
nicobailon merged 1 commit into
mainfrom
fix/bl1105b-3198
Nov 5, 2026
Merged

nicobailon merged 1 commit into
mainfrom
fix/bl1105b-3198

Conversation

@nicobailon

Copy link
Copy Markdown
Owner

After an extension unload removed the subagent tools and a later compaction ran, a session resumed with neither subagent nor subagents_enable, and restarting or forking it didn't help (#3198). Pi stores a checkpoint of the declared tools at compaction, and the activation replay read that checkpoint. The unload before it was folded away, so the existing unload recovery never ran.

When the compacted context starts with a checkpoint, the replay now reads the branch's system messages from before the latest compaction instead, the same history Pi core restores tools from. Without a compaction, sessions already behave this way.

Unchanged: a compaction without a checkpoint is still decided as a new session; tools you removed yourself stay removed; a session that never declared these tools gets nothing added; intact sessions make no new tool change on resume.

A fresh review checked this against real Pi 1.5.0 SessionManager sessions: two compactions, a kept range starting at a system message, a cold session, an unload that was later re-added, and a deliberate removal all give the same result as before. The new test fails on main.

Closes #3198. Thanks to @chuducandev for the report and the synthetic repro.

@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No blocking code defect was identified; merge readiness still requires confirmation of exact-head CI.

Summary

Restores tool selections hidden by a compaction checkpoint by replaying earlier system messages from the current branch.

  • Compacted sessions restore subagent tools that an extension unload turned off.

Reviews (1) · Last reviewed commit: "fix(tool-activation): restore tools an u..." · Reviewed by Greptile

@nicobailon
nicobailon merged commit b563192 into main Nov 5, 2026
19 checks passed
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.

Auto activation strands both subagent and subagents_enable after compaction snapshots a removed tool set (Pi 1.5.0 / 0.85.0)

1 participant