feat: drop chat rate-limiting — remove per-user hour/day request caps and token cap (reverts #711) #1084
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#1084
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Remove all rate-limiting logic from the chat server. Reverts the hour/day request caps and the daily token cap added in #711.
Rationale (from operator): chat is single-operator, not a public service. The rate limits were added defensively in case of prompt-injection leading to Claude loops, but that concern is better addressed by simply ending the chat session. The rate-limit code adds complexity and false failure modes (e.g. overnight reflection loops getting capped) without catching the real risks.
The change
In
docker/chat/server.pyDelete:
_check_rate_limit(user)(around line 220)_record_request(user)(around line 262)_record_tokens(user, tokens)(around line 267)handle_chat(user)— search for_check_rate_limitand_record_request/_record_tokens; delete the conditional blocks and the increment callsKeep the existing
_parse_stream_jsonand conversation-history logic — those are independent.In
docker-compose.ymlDelete the three env vars from the
chat:service (oredge:if #NNNN "chat-in-edge" has already landed):CHAT_MAX_REQUESTS_PER_HOURCHAT_MAX_REQUESTS_PER_DAYCHAT_MAX_TOKENS_PER_DAYIn
.env.example(if present)Remove the same three entries.
Acceptance criteria
grep -r 'CHAT_MAX_' docker/chat/ docker-compose.yml .env.example 2>/dev/nullreturns no matchesgrep -r '_check_rate_limit\|_record_request\|_record_tokens' docker/chat/returns no matches/chatwithout rate-limit failure paths regardless of request volume (smoke test: send 100 messages in a tight loop, all return 200 or a Claude error, none return 429)docker/chat/server.pyhas no references to per-user rate-limit stateshellcheckclean on any shell touched (none expected — this is Python + YAML only)server.pyafter the deletion (e.g.timemay be unused if only rate-limit code used it — verify)Related