Repository navigation
feat: pick a turn a usage limit stopped back up once the limit resets - #673
Merged
Merged
Conversation
omartelo
force-pushed
the
feat/auto-resume-after-limit
branch
3 times, most recently
from
October 8, 2026 15:19
9303962 to
a96d23f
Compare
Claude Code reports the turn through StopFailure (lich-plugin), and lich reads the limit and its reset off the transcript on every done. Codex reports nothing, so open Codex turns are read off their rollout every 30s and ended as interrupted. The continuation is a scheduled prompt due two minutes after the reset, within 24h, dropped by any turn that starts first; the card shows the limit on a rung of its own.
SessionCard was past the 800-line ceiling, and the usage-limit rung added one more branch to the ladder. The ladder and the stores only it reads move to SessionStatusRung; the card keeps one line. render-budget changes because the contract did: the rung is now a child the card repaints with (CARD_CHROME), and a todo event repaints the rung alone instead of the whole card.
omartelo
force-pushed
the
feat/auto-resume-after-limit
branch
from
October 8, 2026 15:25
a96d23f to
ef49639
Compare
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.
When a plan's usage limit stops a turn, lich now says so on the card and picks the turn back up once the limit resets. Gap #14 of the ADE triage (Claude Desktop week 33, cmux 0.65.0).
How each provider signals a limit (measured)
StopFailurewitherror: "rate_limit"instead ofStop; a synthetic assistant line in the transcriptquotaLimits.resetsAton that linedoneand parks the continuationcodex exec)UserPromptSubmitfires,Stopnever does; the rollout writes atoken_countwith a window at 100%, thentask_completewith no messagerate_limits.*.resets_atinterrupted, parks the continuationsession.statusretryauto_retry_start/auto_retry_endClaude Code 2.1.293 also ships its own
autoContinueAtUsageLimit, gated per account by the server (off on the account measured). lich lives with it rather than toggling it: see below.Design
StopFailureasdone(fix: report Claude Code's StopFailure as done lich-plugin#48), andnoteLimitreads the limit off the transcript on everydone. Codex:RunLimitWatchreads the rollout of each open Codex turn every 30s and ends a limited one throughnoteInterrupt, which also fixes the card spinning forever.relay.ParkResumeparks a scheduled prompt (the existing one,later.go) due two minutes after the reset, so it shows on the card, survives a restart and is typed like any scheduled prompt. Nothing is parked for a reset already past or more than 24h out (Claude Code's own horizon), nor over a prompt already parked.busyon that session before the prompt is due drops it (dropResume): the person going on by hand, Claude Code's own auto-continue (which resumes at the reset itself, hence the two-minute grace), or a relay delivery. A prompt the person parked in its place stays.Session limit · resumes in 2h, orWeekly limit · resets Mon 09:00when nothing will resume it. Cancelling goes through the existing Scheduled… item and its Cancel it.Ceilings (in
docs/ceilings.md)ponytail:inresume.go); a column on the row is the upgrade if that ever matters.codex exec, not on the TUI.Provider support rows added to
README.mdandREADME.zh-CN.md; hook contract updated indocs/hooks/session-state.md(no new state, no fixture change).Refactor: the card's status rung
SessionCard.tsxwas already past the 800-line ceiling, and this adds one more rung to its ladder. The ladder, and the stores only it reads (relay, handoff, inbox, limit, todo, tool, waiting reason), move toSessionStatusRung.tsx; the card keeps one line and drops to ~710 lines.render-budget.test.tsxchanges because the contract did, not to buy a green run: the rung is a child the card repaints with, so it joinsCARD_CHROME, and a todo event now repaints the rung alone instead of the whole card (narrower than before).Tests
internal/terminal/limit_test.go: transcript and rollout readers, against the lines measured on a real Claude transcript and a Codex rig (fake responses endpoint answeringusage_limit_reached).internal/terminal/limit_service_test.go(!windows, reusesstubBins):doneon a Claude limit parks the resume; the watch ends a limited Codex turn.internal/relay/resume_test.go: park, horizon, the person's prompt, drop onbusy.session-limit-store.test.ts,limit-line.test.ts.Local gate: gofmt,
go vet,go test ./..., the cross-compile loop,biome ci(exit 0), vitest with coverage (1973 passing),pnpm build. The new async tests ran 100 times clean.Needs lichdotdev/lich-plugin#48 for Claude Code; Codex works without it.