Skip to content

feat: resume threads automatically after a usage limit resets - #35

Merged
r4iju merged 2 commits into
mainfrom
feat/auto-resume-usage-limit
Sep 24, 2026
Merged

r4iju merged 2 commits into
mainfrom
feat/auto-resume-usage-limit

Conversation

@r4iju

@r4iju r4iju commented Sep 24, 2026

Copy link
Copy Markdown
Owner

When Claude, Codex, or Grok stops a thread with "usage limit reached", you have to be around when the limit resets to send the message again. Now the thread can pick up by itself.

How

  • Threads record the limit and its reset time (new usageLimit on the thread, migration 55). The Claude, Codex, and Grok adapters emit a new turn.usage-limited runtime event. If a provider gives no reset time, the server uses its published usage windows.
  • A banner (web/desktop) or card (mobile) shows the reset time with Resume at … and Cancel.
  • UsageLimitResumeReactor sends the resume message a minute after the reset, even with every client closed. First it stops a Claude turn still holding on the limit.
  • Server settings (web Settings → General, mobile agent behavior):
    • Resume after usage limits: off by default. Schedules every limited thread.
    • Resume message: defaults to go on.
    • Turn off fast mode when resuming: on by default. Fast mode stays off afterwards.
  • Automatic scheduling retries once, so at most two resumes in a row.
  • Not supported: Cursor, OpenCode, and Antigravity, which don't report usage limits to T3.

Verified

  • Typecheck passes for contracts, server, client-runtime, web, and mobile.
  • Lint and format pass on the changed files.
  • UsageLimitResumePolicy.test.ts is new: 8 tests that fail without the implementation.
  • Orchestration (144), client-runtime state (560), and web settings (477) tests pass.
  • ThreadSettlementReactor.test.ts storage-cleanup failures are unrelated: they also fail on main.
  • Fork CI does not run, so these local checks are the gate.

When Claude, Codex, or Grok stops a thread on a usage limit, the thread
records when the limit resets. A banner (web) or card (mobile) offers to
resume at that time; the server sends the configured message ("go on")
a minute after the reset, stopping a turn Claude still holds on the
limit first. A server setting schedules this for every limited thread,
retrying once, and can drop fast mode on the resumed turn.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Sep 24, 2026
- Cancel sticks: only a new stop is auto-scheduled, not a re-report.
- A parked turn that carries on by itself clears its limit instead of
  being interrupted by the resume.
- A turn parked on several windows waits for the last reset.
- Fast mode off is saved on the thread, not just the resumed turn.
- Reset times name the day when they are not today.
- The minute tick reads only threads with a pending resume.
@r4iju
r4iju merged commit a867521 into main Sep 24, 2026
3 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant