Repository navigation
Description
This was generated by AI during triage.
Settled in a grill-with-docs session: docs/grill-with-docs/2026-host-suspension.md (Q1.1–Q2.5).
Problem Statement
A Command whose host goes to sleep keeps its stage clock running. A laptop's clamshell sleep, or a Lima VM paused while its Mac sleeps, shows up as hours of stage time when nothing ran at all.
#1975's implement stage reads about 10 hours, but its Session worked for 29 minutes. The rest was the laptop asleep. That time inflates:
- the stage time in
thirdshift show, the Console's run page, the Stages page and Run metrics; - the samples that make up the stage's Usual range;
- the Slow and Silent checks on a live run once the host wakes.
Nothing records that the host was suspended. Explaining the 10 hours took the macOS power log and a stage-by-stage reading of the Session trace.
Solution
Every Command measures its own Suspended time: time when its host was not running at all. It measures this as wall-clock time running ahead of monotonic time by at least one minute. The Command record keeps the Suspended time per stage, updated while the stage is live, and the Command log gets one line per suspension.
A stage's time stays wall-clock time and is shown with its Suspended time beside it, e.g. "10 h 6 m · 9 h 40 m suspended". A stage with Suspended time is not a sample for its Usual range. Slow and Silent don't count Suspended time. An Experiment or Process eval marks a Trial with Suspended time and leaves its time out of time comparisons.
User Stories
- As the Day shift, I want a stage's Suspended time shown next to its time in
thirdshift show, so that a 10-hour stage on a laptop explains itself. - As the Day shift, I want the same shown on the Console's run page, so that I don't need the host's power log to understand a long run.
- As the Day shift, I want the Stages page to show Suspended time beside a stage time, so that an outlier there explains itself.
- As the Day shift, I want one Command log line per suspension, such as "host was suspended 1 h 38 m", so that reading the log tells me the host slept and for how long.
- As the Day shift, I want a run that just woke from a suspension not to read Slow because of the hours it was suspended, so that Needs you shows only runs that really are taking longer than usual.
- As the Day shift, I want a run that just woke from a suspension not to read Silent because its logs couldn't grow while nothing ran, so that a sleeping host doesn't look like a stuck Session.
- As the Day shift, I want a Console read from another host while this one is still suspended not to show a long Silent stretch caused by the suspension once the record has it, so that my fleet view stays calm overnight.
- As the Day shift, I want a stage that had Suspended time left out of its repository's Usual range, so that sleepy nights on a laptop don't widen the range used for Slow.
- As the Day shift, I want stage times to stay wall-clock times, so that a CI watch the host slept through still shows how long it really waited.
- As the Day shift, I want small clock corrections such as NTP steps not recorded as Suspended time, so that only real suspensions appear.
- As the Day shift, I want a suspension never to make a Needs you row or Inbox note of its own, so that the Inbox stays a list of things I have to act on.
- As the Day shift, I want Passes, Spec runs, Security runs and Ticket runs all to measure Suspended time, so that every Command record tells the same truth.
- As an Experiment author, I want a Trial with Suspended time marked, so that I know its time isn't comparable.
- As an Experiment author, I want such a Trial's time left out of time comparisons while its outcome and cost still count, so that one laptop nap doesn't skew an arm's timing or cost me a rerun.
- As a Process eval author, I want the same rule for Process eval Trials, so that timing comparisons across Processes stay fair.
- As the Day shift, I want Command records written before this change read as having no Suspended time, so that old history keeps working unchanged.
- As the Day shift on a host that never sleeps, I want nothing to change, so that always-on hosts see no new noise.
- As a reader of a Ticket run's dispatched Command, I want each Command to carry its own Suspended time, so that the Pickup run that dispatched it and the dispatched run each say what happened to them.
- As a maintainer, I want only the running Command to measure Suspended time, and the Console never to infer it, so that a stalled run is never mistaken for a sleeping host.
Implementation Decisions
- Measurement. The running Command compares the wall clock with a monotonic clock that stops while the host is suspended. When wall-clock elapsed time has run at least one minute ahead of monotonic elapsed time since the previous reading, the difference is a suspension. Smaller gaps are ignored. The one-minute threshold is fixed, not configurable.
- Lima
vzguest: the monotonic clock stops while the VM is paused,CLOCK_BOOTTIMEdoesn't count the pause either, and the wall clock is stepped on wake. Confirmed. - macOS: Rust's
Instantuses a clock that stops in sleep. Expected from the Rust docs; not yet tested on the Mac.
- Lima
- Clock seam. The logs module's effects interface (
Outside) already supplies the wall clock to the recorder. It gains a monotonic reading next to it, so that recorder tests can script a suspension without sleeping. The real implementation usesInstant. - Live sampling. A long Session may not touch the Command record for hours. The Command checks for a suspension at least every 30 seconds while it is live, and the Suspended time reaches the record within about a minute of wake. It is not held back until the next stage transition. The implementer chooses the mechanism; the requirement is that a live stage's record carries its Suspended time soon after wake.
- Command record schema. Each stage gains an optional Suspended time in seconds. An absent field means zero, so older records parse unchanged. A stage's own time is still the wall-clock gap between its start and the next stage's start, or the Command's end.
- Command log. One line per suspension, such as "host was suspended 1 h 38 m", written when the suspension is detected.
- Display.
thirdshift show,thirdshift status's stage text where it shows a stage time, the Console's run page and the Stages page show " · suspended" when it is non-zero, and nothing extra otherwise. - Usual range. A stage with any recorded Suspended time is not a sample.
- Slow. A stage is Slow when its age minus its Suspended time passes the top of its Usual range. The step 2 multiple uses the same age. On CI watch this fires late after a suspension, which was accepted (Q2.1).
- Silent. The quiet time leaves out Suspended time recorded since the logs last grew.
- Inbox. Suspended time never makes a Needs you row, an Inbox note or a Dismissal target of its own.
- Experiments and Process evals. A Trial whose Command recorded Suspended time is marked, and its time is left out of time comparisons and summaries. Its outcome, cost and other results still count. Reports say how many Trials were excluded from timing.
- Scope of measurement. Every Command: Passes, Ticket runs, Spec runs, Fix runs, Security runs, Triage runs, Experiments and Process evals.
Testing Decisions
-
Test external behavior: what the Command record, Command log,
show/statustext, Console pages and Experiment reports say. Don't test how sampling is scheduled. -
Recording: script a suspension through the logs effects seam (wall clock jumps, monotonic doesn't). Assert:
- the stage's Suspended time in the record and the one Command log line;
- a 30-second NTP-style step is not recorded;
- a live stage's record gets the Suspended time without a stage transition.
Prior art: the recorder tests in the logs recording module, which already drive a fake
Outside. -
Reading and health: use fixture Command records carrying Suspended time. Assert that Slow and Silent ignore it, that the Usual range leaves those stages out, and that a record without the field reads as zero. Prior art: the logs reading inventory and metrics tests, and
tests/console/watching.rsandtests/console/metrics.rsfor the Console. -
Display: assert the "· N suspended" text in
showand on the Console run and Stages pages. Prior art:tests/console.rsandtests/command_logs.rs. -
Experiments: a fixture Trial with Suspended time is marked and excluded from time comparisons, while its outcome and cost are kept. Prior art:
tests/experiments.rs. -
No test should sleep for real to produce a suspension.
Out of Scope
- Keeping a host awake: caffeinate,
pmset, or Lima settings. That is Day shift host setup. - Scheduling around host sleep, such as catching up missed Passes after wake.
- Making the threshold configurable (Q2.3).
- Subtracting Suspended time from stage times (Q1.2).
- Rewriting existing Command records.
- Session-level timings inside a Harness's own trace.
Further Notes
- Evidence from A failed Review or skill worktree acquisition leaves an empty temp directory behind #1975 on a Lima VM:
- the implement stage ran 22:12 → 08:18, while the Session reported
29m 12s; - the laptop entered clamshell sleep on battery at 20:41 and fully woke at 08:00:57;
- there were 9
api_retry … error: unknownevents after 17–98 minute gaps, and a one-modulecargo testheartbeat jumped from 30 s to 3,015 s.
- the implement stage ran 22:12 → 08:18, while the Session reported
- The "slow" row on A failed Review or skill worktree acquisition leaves an empty temp directory behind #1975's CI watch was genuine GitHub CI time and is unaffected.
- Glossary: Suspended time added; Usual range, Slow and Silent updated. Docs PR: Define Suspended time and record the #2026 grill #2030.
- Tickets follow via
to-tickets. A likely split:- measure and record (seam, live sampling, record field, log line);
- read side (display, Usual range, Slow and Silent), blocked by 1;
- Experiments and Process evals, blocked by 1.
Activity
JacobStephens2 commentedon Nov 11, 2026
Investigation summary
Confirmed the accounting mechanism on Base branch main at 895f4b7. The supplied issue says design questions are still being settled and a Spec will follow; implementation should wait for those decisions.
Evidence:
Confirmation:
The reported Lima pause, maintenance wakes and Session trace were not independently reproduced: their underlying artifacts are unavailable in this worktree. The code supports the reported symptoms, but does not establish their physical cause or validate wall-clock-minus-monotonic as an exact suspension measurement.
Next step: finish the design round, record the decisions in a Spec, and shape its Tickets through the questionnaire below. No separate matching open issue was found.
Questionnaire
For the Day shift shaping #2026: repository investigation confirms wall-clock accounting across stage times, Run metrics, Usual ranges and health. The existing issue says a design round is underway; please reuse its settled answers or link the agreed Spec.
[-]Stage times and health count time the host was suspended[/-][+]Spec: record host Suspended time, and keep it out of stage health and Usual ranges[/+]JacobStephens2 commentedon Nov 11, 2026
The Triage run's questionnaire is answered by the Spec now in this issue's body, settled in
docs/grill-with-docs/2026-host-suspension.md:I've taken
agent-failedoff: the Day shift has taken this over. It staysready-for-humanuntil its Tickets are published withto-tickets, so that neither Pickup nor a Triage Pass takes it in the meantime.16 remaining items
JacobStephens2 commentedon Nov 12, 2026
Handing back. All four Tickets merged (#2032–#2035). The Spec run then failed when a Fix run on PR #2053 hit a full disk on its host (
No space left on device, since cleared). PR #2053 is still a draft and now has conflicts with main. The next Pickup continues it.JacobStephens2 commentedon Nov 12, 2026
This comment was generated by AI.
thirdshift's Run on this issue failed, so it waits for the Day shift.
issue-2026, if it reached originPut
ready-for-agentback to retry.JacobStephens2 commentedon Nov 12, 2026
Handing back again. The last retry on thirdshift.app failed because an old checkout of issue-2026 was still there, stuck mid-merge after the disk-full failure. That merge's conflict resolution is saved on the host, and the checkout has been removed. The next Pickup continues PR #2053 from origin's issue-2026.