Skip to content

fix: remove tool notification rate limit#97

Merged
QueryPlanner merged 1 commit into
mainfrom
fix/remove-tool-notification-rate-limit
May 24, 2026
Merged

fix: remove tool notification rate limit#97
QueryPlanner merged 1 commit into
mainfrom
fix/remove-tool-notification-rate-limit

Conversation

@QueryPlanner
Copy link
Copy Markdown
Owner

What

Remove rate limiting from Telegram tool notifications so each parallel tool call gets its own notification.

Why

The previous implementation used a 100ms rate limit window for tool notifications. When the agent made 3 parallel log_meal calls within 7ms, only the first notification was sent. This was confusing because the user only saw one notification but the agent reported calling the tool 3 times.

How

  • Removed rate limiting logic from notify_telegram_before_tool() in src/blacki/callbacks.py
  • Removed unused _TOOL_NOTIFY_* state variables
  • Kept rate limiting for notify_telegram_after_model() (intermediate LLM text) since streaming could still spam
  • Updated test test_notify_rate_limits_per_chattest_notify_sends_for_each_tool_call

Tests

  • All 828 tests pass
  • Ruff format/check pass
  • Mypy type check passes
  • 100% test coverage maintained

- Remove rate limiting from notify_telegram_before_tool
- Each parallel tool call now gets its own notification
- Keep rate limiting for intermediate LLM text notifications
- Update tests to expect all notifications through
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the rate-limiting logic for Telegram tool notifications, ensuring that a notification is sent for every tool call. The changes include the removal of rate-limiting state variables and the associated logic within the notification function, along with updates to the test suite to reflect the new behavior. I have no feedback to provide as there were no review comments.

@QueryPlanner QueryPlanner merged commit 0e90071 into main May 24, 2026
1 check passed
@QueryPlanner QueryPlanner deleted the fix/remove-tool-notification-rate-limit branch May 24, 2026 11:28
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