Skip to content

Keep monitor off after tree navigation, and its rate limit across a clock step - #451

Merged
ilovepixelart merged 3 commits into
mainfrom
fix/monitor-follows-bash-after-tree
Nov 15, 2026
Merged

ilovepixelart merged 3 commits into
mainfrom
fix/monitor-follows-bash-after-tree

Conversation

@ilovepixelart

Copy link
Copy Markdown
Owner

Two defects in extensions/monitor.ts.

monitor returned after tree navigation in a session without bash. 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.

Session started with --tools -bash Shell tools sent to the model
At start, after two turns task_stop
After /tree to the first message, before task_stop, monitor
After /tree to the first message, after task_stop

The check now also runs on session_tree. The test drives a real pi session through two turns and navigateTree.

The rate limit switched off when the clock stepped back. tokenBucket added 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 check passes (Biome, strict tsc, Vitest)
  • Tests cover the change

ilovepixelart and others added 3 commits November 15, 2026 12:36
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.
@sonarqubecloud

Copy link
Copy Markdown

@ilovepixelart
ilovepixelart merged commit 49b34a1 into main Nov 15, 2026
13 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.

1 participant