skip to content
Replays

Backoff That Waits for the Reset Time

When a usage window runs out, sleep until it reopens instead of halting the run.

Gantry sprints

0 milestones 4 sprints

When a usage window runs out, sleep until it reopens instead of halting the run.

36m 12s total 5m 39s per sprint

15.8M tokens in 100.9k tokens out

$16.37 nominal cost

This job changed a usage-window stop from a terminal harness failure into a retryable wait. The run split the work by responsibility: shared classification first, retry-loop plumbing next, Claude-specific reset parsing after the loop could consume a hint, and operator-facing output plus docs last.

The durable design is the separation between a harness-neutral retry outcome and the harness that can compute a wall-clock reset. Current Gantry still carries that shape, with later work extending the same reset-aware idea beyond the original Claude parser.

How this walkthrough is structured

Feature

What did the run build and ship?

Gantry now recognizes usage and session limits as retryable, carries optional reset waits through the retry loop, and presents long waits as intentional usage-limit pauses instead of generic retry countdowns.

Build

How did Gantry structure the work?

The cut isolated reset-aware backoff into classification, retry accounting, harness parsing, and presentation, and the only red gate in the run belonged to baseline setup before any sprint owned code.

Broaden Transient Classification

0 agents 2m 17s wall time 3.5k tokens out $1.19 nominal cost

The shared matcher still recognizes session-limit and usage-limit wording, including the anchored hit-your-limit shape, while keeping ordinary ceiling messages out of the transient class. That behavior stands in the harness-neutral classification helper and is covered by tests that exercise both matching and nonmatching text. The sprint's contribution remains directly visible rather than folded away.

This first piece was narrow enough for a fresh agent because it changed only the shared transient matcher. The brief kept it away from timing, retry budgets, and harness-specific reset parsing; its job was to decide whether subscription-window wording belongs in the same retryable class as existing transient failures. Its boundary stayed green, with no recovery or re-plan attached to the sprint.

Wait-Aware Retry Loop

0 agents 12m 4s wall time 42.4k tokens out $7.28 nominal cost

The retry loop now distinguishes unhinted transient failures from hinted usage-limit waits. Hinted waits sleep for the supplied duration, use their own bounded counter, remain abort-aware, and surface reset-wait metadata through retry events. The original build module touched by this sprint is gone from today's tree, but the logic survives in the agent module and the event data remains present in domain, history, headless, and TUI code.

This was the structural sprint: it added an optional wait hint to transient outcomes and made retry accounting understand a separate usage-reset path. The cut was workable because tests could inject hinted transients into the retry loop without needing real Claude output, timezones, or wall-clock parsing. Its sprint record stayed green, so the new interface was proven before any harness tried to feed it real reset text.

Parse Claude Reset Times

0 agents 5m 18s wall time 19k tokens out $2.36 nominal cost

The Claude harness still has a local reset parser with explicit extraction, date-command timezone resolution, buffer and clamp constants, and deterministic tests around the pure core. When Claude classifies a usage-limit transient with a parseable reset phrase, it supplies the wait hint; ordinary transient output keeps the fixed-schedule path. Later Codex work added its own reset parser, but this sprint's Claude-specific path remains identifiable.

The parser sprint was held until the wait-hint interface already existed, which kept the environment-coupled work local to one harness. Its brief gave the agent a concrete target: parse Claude's reset phrase, resolve the named zone through the system date command, inject time sources for tests, and fall back when parsing fails. It passed without a recorded recovery, so the timezone-sensitive part did not force a change to the earlier loop boundary.

Operator Visibility and Documentation

0 agents 6m wall time 19.4k tokens out $3.33 nominal cost

Headless output and the TUI now render usage-limit waits as distinct reset waits with the reset phrase and human-readable duration, while ordinary transient retries keep the generic countdown treatment. Current harness docs describe Claude as reset-aware and explain that harnesses without parseable reset times fall back to the fixed retry schedule; the README text from this job has since been rewritten. The rendered behavior is still present, and the docs have evolved to include later Codex reset support.

This final piece was presentation and documentation after the behavior already existed. The agent did not need to reason about retry decisions; it consumed the reset-wait fields from the previous sprint and made the visible line and card say what kind of wait was happening. Its green boundary fits the cut: the feature risk had already been concentrated upstream, leaving this sprint to expose and describe it.