Repository navigation
fix: check the assistant's per-address limit first - #620
Merged
Merged
Conversation
|
Automatic reviews are disabled for this repository. |
|
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.



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.mdanddocs/security.mddescribe 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 viaci-local.sh fast.Migrations
None.
Screenshots
None.