Repository navigation
Keep monitor off after tree navigation, and its rate limit across a clock step - #451
Merged
Merged
Conversation
monitor is removed at session_start where bash is not active. pi 1.5 rebuilds the active tools on tree navigation without a session_start and activates every extension tool the branch never mentioned, so in a session started with `--tools -bash` the model was sent `monitor` again after /tree and could run shell commands through it. The check now also runs on session_tree.
tokenBucket added a negative refill when the clock moved back by more than the refill interval, leaving a negative token count that never compared equal to zero: every later event was admitted and the monitor was never stopped for flooding. With an empty bucket and a 500 ms step back, 3000 of 3000 events over 600 s were delivered instead of 300. A refill that gains nothing or less is skipped, so the bucket stays empty until the clock has caught up.
|
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.



Two defects in
extensions/monitor.ts.monitorreturned after tree navigation in a session without bash.monitoris removed atsession_startwherebashis not active. pi 1.5 rebuilds the active tools on tree navigation without asession_startand activates every extension tool the branch never mentioned.--tools -bashtask_stop/treeto the first message, beforetask_stop,monitor/treeto the first message, aftertask_stopThe check now also runs on
session_tree. The test drives a real pi session through two turns andnavigateTree.The rate limit switched off when the clock stepped back.
tokenBucketadded a negative refill, leaving a negative token count that never compared equal to zero, so every later event was admitted and the flood stop never triggered. A refill that gains nothing or less is now skipped.npm run checkpasses (Biome, strict tsc, Vitest)