Skip to content

wait: what arrived since it last woke the supervisor counts as new - #96

Merged
hhff merged 4 commits into
mainfrom
wait-since-last-tick
Nov 4, 2026
Merged

hhff merged 4 commits into
mainfrom
wait-since-last-tick

Conversation

@hhff

@hhff hhff commented Nov 4, 2026

Copy link
Copy Markdown
Member

What

  • scripts/devteam.mjs, wait: wait records when it last woke the supervisor (run/wait-since, registered in RUN_KNOWN so fleet status doesn't flag it). An open message to the supervisor, or an owner line, created after that moment is reported straight away, even though it's already in wait's first snapshot. Other items keep the old rule: only what's new since the first snapshot wakes it.
  • test/kit.test.mjs:
    • A message sent before wait starts wakes it at once, and only once, when left open.
    • The fleet-park test joins the pane's wrapped lines before matching. Run inside an agent session there are nine markers to strip, and the shell wrapped the env -u line at 80 columns, mid-token.

Why

wait took its first snapshot as the baseline. A worker's message that landed between the end of the supervisor's tick and that snapshot was taken for an old one, so the supervisor slept the whole next tick, 15 minutes by default, while the worker waited. The snapshot runs metrics, which on a long log (Stacks: about 8.9k lines) takes a while, so the window was wide. The same race failed "a worker's message wakes it" three times on a loaded Mac.

Design note

"New" means since the last time wait woke the supervisor, not since its last log line. A message the supervisor deliberately leaves open would otherwise wake it on every wait, which is a busy loop. With the marker it wakes it once.

Authority

This only touches when wait returns. It writes nothing to the log, and run/wait-since is a timestamp that nothing authorizes from.

Migration

None.

Tests

Local, sequential, before merging main: Node 24.14.1 42/42, 20.19.6 42/42, 18.20.4 41/42; the failure was the pane wrap, fixed here and rerun green. Main (#93) is merged in; CI runs at the head.

🤖 Generated with Claude Code

hhff and others added 4 commits November 4, 2026 16:33
wait took its first snapshot (open messages to the supervisor, owner lines, metrics) as the
baseline, so a worker's message that landed between the end of the tick and that snapshot was
taken for an old one: the supervisor slept the whole next tick while the worker waited. The
snapshot runs metrics, which on a long log takes a while, so the window was wide. wait now records
when it last woke the supervisor (run/wait-since) and reports anything that came in after that at
once. A message the supervisor leaves open wakes it once, not on every wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run inside an agent session there are nine markers to strip, and the shell wrapped the env -u
line at 80 columns, mid-token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… never answers

The probe gave it 5s and then carried on regardless; on a loaded machine Node 18's dashboard took
longer, and the test's first real request failed with a bare 'fetch failed'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hhff

hhff commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Review (upstream loop, author's own PR):

  • Authority: wait only changes when it returns. It writes no log line, and run/wait-since is a timestamp nothing authorizes from. No path to the owner.
  • Busy-loop check: a message left open wakes the supervisor once. The new subtest asserts the second wait says "nothing new".
  • run/wait-since is in RUN_KNOWN, so fleet status doesn't block a move on it.
  • Test robustness: a shared serverUp waits up to 30s for each test dashboard and fails there if it never answers. The fleet-park pane check joins wrapped lines.
  • Tests at the merged head: CI 18/20/22/24 green at aeee7f2. Local Node 24.14.1 and 20.19.6 43/43. Local Node 18.20.4: one failure in the dashboard review test's final review-answer POST ('fetch failed'), macOS + Node 18 only and not touched by this PR. Investigating separately.

@hhff
hhff merged commit 21fa1be into main Nov 4, 2026
4 checks passed
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