oliver-zehentleitner / maity
[runner-stability] runner: restart a placement whose session stopped listening, on its own (watchdog)
tsk-twmms66p1ww4 Done An agent
Owner's request (2026-11-20 20:30Z, chat): "automatische Kontrolle". Seen in the lead's presence round at 20:26Z: two Codex reviewer placements (maity-review-codex-002#ukxh since 19:09Z, maity-review-codex-004#tcun since 01:08Z) reported running while their sessions had stopped listening; nothing noticed it until the lead restarted them by hand (maity placement restart), and both came back. A third (maity-review-codex-003, plc-j1819xg4jadf) reports running but has never joined.
Do: the runner watches each placement it runs and acts when the agent behind it is gone:
- the hub already knows when a session stops listening (
member_not_listening, §5.3) and when a placement never joined; the runner reads that for its own placements (from its stream or its placement reads), or the hub tells the runner; - after a grace period (a runner setting; say 15 minutes of not listening, or no join within N minutes of a start), the runner restarts the placement once, as
maity placement restartdoes, and reports it (reported.detail, a new code if needed: contract first); - after a second failure within a window it stops retrying and reports a state the owner and the lead see (no restart loop);
- a placement whose agent is dormant, paused or isolated is never restarted for not listening.
Done when: a test per case (not listening past the grace, never joined, dormant/paused/isolated left alone, the second failure stops); docs/runners.md says what the runner does and how to set the grace; the contract if a code or a field changes. A security leg is not needed unless the runner gains a new right.
Notes
Lotse · Nov 20, 2026, 20:34 UTC
Lead, 2026-11-20 20:34Z: the owner's direction for this card (chat seq 179583): look at the cause first, fix it technically, learn and automate with intelligence; a blind restart does nothing for a failed login. So the card turns diagnosis-first (proposal to the owner, seq 179589; build only after his answer):
- Detect and record. When a placement's agent stops listening or never joins, the runner collects what it can see: whether the harness process lives, its exit code, the tail of its tmux pane, the hub's answer to the pickup and exchange, login state, usage-limit messages. It records one finding with a cause class, visible to the owner and the lead.
- One reaction per cause class:
- harness crashed: restart (once, then stop and report);
- harness alive but
maity waitnot running: nudge the agent, no restart; - usage limit reached: wait until the reset, then start;
- login expired or invalid: never restart; tell the owner at once;
- pickup refused: report the hub's code and why (tsk-fveaj86ec6e2), no restart;
- unknown: one restart, and the finding stays for analysis.
- Learn. Findings are kept; a recurring unknown cause becomes a new class with its own reaction.
Start from what §15.14 (agent_health, nudge, flapping) already has. No secret, credential or login token in any finding.
Lotse · Nov 20, 2026, 20:42 UTC
Lead, 2026-11-20 20:42Z: the owner adds stage 1 of the runner logs to this card (chat seq 179663 proposal, his answer seq 179734: "ja paßt", and the lead may read them: "du als mein admin darfst das").
Stage 1, in this card's contract and PRs: with each
finding, the runner sends its own log lines for that placement (the runner's lines: start, exit code, refused pickup or exchange, restart, sandbox and skill warnings, never the session's pane output), the last few hundred, bounded in bytes. The hub keeps them with the finding. Readers: the runner owner, the agent's owner, and the project's admins of trust admin (the lead). Not other members.Rules: the runner's own log lines only; no pane text, no secret-shaped string (the CLI's credential check applies before sending), bounded size and count, kept as long as the finding. Name the readers in the contract.
Stage 2 (the end of the session's terminal log, on request) is its own card, later.