Skip to content

feat: added safe quota redistribution - #228

Merged
jacobcxdev merged 1 commit into
mainfrom
jacobcxdev/feat/quota-redistribution
Oct 10, 2026
Merged

jacobcxdev merged 1 commit into
mainfrom
jacobcxdev/feat/quota-redistribution

Conversation

@jacobcxdev

Copy link
Copy Markdown
Owner

Chats admitted on an exhausted account could remain there after another account regained quota: lease invalidation skipped required continuity. Added cq proxy leases redistribute to schedule fresh account selection at the next safe request boundary, plus automatic scheduling after successful banked resets and fresh detected quota recovery.

Current responses finish unchanged. Migration uses existing routing policy and recovery admission and prefers confirmed included quota. WebSocket account-owned deltas request full-history resynchronisation before moving. HTTP previous_response_id continuations defer migration until portable full-history input; those continuations can still use extra credits meanwhile. Pending scheduling survives restart; banked reset consumption remains explicit.

Validation:

  • go build ./... and go vet ./... passed.
  • go test -race -count=1 ./... passed.
  • HTTP/WebSocket regressions covered genuine next turns, portable state, reconnects after restart, active response completion and exhausted-account recovery.
  • Reset regressions covered freshness, partial recovery, scoped quota, durable deduplication, overlapping triggers and notification failures.
  • Authenticated control regressions covered encoded paths, malformed requests and strict command responses.

- Scheduled account selection at safe request boundaries without replaying active work.
- Added automatic scheduling after explicit resets and fresh quota recovery.
- Preserved continuity, routing constraints and pending state across restarts.
- Covered migration, reset freshness and authenticated controls with regression tests.
@jacobcxdev jacobcxdev self-assigned this Oct 10, 2026
@jacobcxdev
jacobcxdev merged commit 31c773b into main Oct 10, 2026
1 check passed
@jacobcxdev
jacobcxdev deleted the jacobcxdev/feat/quota-redistribution branch October 10, 2026 09:35
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