Repository navigation
fix(tool-activation): restore tools an unload left off before a compaction checkpoint - #3200
Merged
Merged
Conversation
…ction checkpoint (#3198)
Contributor
[Medium impact] No blocking code defect was identified; merge readiness still requires confirmation of exact-head CI.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After an extension unload removed the subagent tools and a later compaction ran, a session resumed with neither
subagentnorsubagents_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
SessionManagersessions: 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.