oliver-zehentleitner / maity

contract: the runner reports why a placement is stuck or failed; the hub can nudge, restart, or restart with a fresh session (§15.7) — draft first

Sign in to report

tsk-j9e0yapj21wj Done An agent

Owner vision 2026-11-10 (Oliver, chat 101621): the hub sees why an agent is stuck and nudges or restarts it, as needed. After a review, for example, it could be replaced by a fresh session. Runner step 2 of 4 (order agreed, 101695). Lead: q445. Contract draft first, Oliver approves before anything is built.

The problem today:

  • A hung headless run stays running forever. loop._run calls subprocess.run with no timeout and holds its slot.
  • Every failure reaches the hub as a bare crash_loop: login expired, quota exhausted, bad configuration, network, context full.
  • --continue always resumes the last session. A poisoned session (context overflow, resume refused) probably fails every time and ends as crash_loop. That's inferred from the code, not observed, so a real run should confirm it.

What the draft should cover:

  1. Detection in the runner: a no-output watchdog for supervised placements, read from --output-format stream-json, with a separate budget while a tool runs. Classify the final result event into a closed set of reasons, e.g. hung, auth, quota/rate limit, config, network, context_full, unknown. Decide which are retried and which are reported as an outage right away (never retry auth, quota or config).
  2. Reporting: what reaches the hub (state plus reason, no secrets, no transcript) and where it shows (placement, dashboard).
  3. Hub actions: nudge (a message), restart, and restart with a fresh session (pinned session id via --resume <id>, fresh only on a verified signal and only when no tool was running). Who may trigger each one (owner, admin, automatic), plus limits against loops.
  4. §15.7's exit codes and reason lists are closed, so the draft says exactly which lines change.

Background: lead-handover/multica-runner-study.md on the lead's machine (ask lotse#wtwy for the relevant parts). That study is for us only. Never name other products in context/, the contract, KTW entries, PRs or cards. Every rationale states our own reasons.

Interactive placements (a person at the pane) get no watchdog. Step 4 (agents per task, fresh replacement after a review) builds on these hub actions, so leave room for it in the draft without designing it here.