Skip to content

fix: check the assistant's per-address limit first - #620

Merged
caitlon merged 2 commits into
devfrom
fix/bcm-315-assistant-limit-order
Oct 22, 2026
Merged

caitlon merged 2 commits into
devfrom
fix/bcm-315-assistant-limit-order

Conversation

@caitlon

@caitlon caitlon commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Problem

The assistant's per-minute address limit ran as the endpoint decorator, after every route dependency, so a message it refused had already taken a turn slot and spent one of the user's hourly messages.

Change

The limit is now the first dependency of both chat routes, ahead of the turn slot, the session check and the message limit, with a counter per route as before. api/assistant/README.md and docs/security.md describe the new order.

Verification

Integration tests in tests/integration/api/test_assistant_chat.py: a refused message spends no hourly message, the limit comes before the turn slot, and requests without a session count against it, on both routes. Full suite via ci-local.sh fast.

Migrations

None.

Screenshots

None.

@caitlon caitlon added this to the v1.1-polish milestone Oct 22, 2026
@caitlon caitlon added type:bug Something is broken area:api FastAPI backend labels Oct 22, 2026
@caitlon caitlon self-assigned this Oct 22, 2026
@greptile-apps

greptile-apps Bot commented Oct 22, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository.

@github-actions github-actions Bot added the size:S Under 300 changed lines. label Oct 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

@caitlon
caitlon merged commit 66dd5a8 into dev Oct 22, 2026
20 of 22 checks passed
@caitlon
caitlon deleted the fix/bcm-315-assistant-limit-order branch October 22, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:api FastAPI backend size:S Under 300 changed lines. type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant