Skip to content

Worktree report-back dead-letters against a busy orchestrator — finished workers never trigger review #523

Description

@dotdevdotdev

Problem

Multi-session orchestration's core promise — spawn worktree workers, they report back when done, the orchestrator reviews — is broken in practice. Finished workers push their PRs and go idle, but the orchestrator is never driven to review them. The human has to manually prompt "what's done?" every time. This is the #1 multi-session reliability failure.

Root cause (confirmed)

The worktree-session role instructs every worker to report back via the POLITE channel:

agentwire msg send --to <creator> --kind done "<session>: <PR URL>"

agentwire msg only injects when the recipient's input box is EMPTY (prompt_router.prompt_is_empty) — by design, so it never clobbers a human's half-typed draft. But an orchestrator session's box is frequently non-empty (mid-turn / agent busy / residual text), so the done report defers (box_not_empty), bumps attempts, and dead-letters after 40 attempts — silently.

Evidence — agentwire msg dead for the orchestrator shows 18 dead-lettered done reports:

The workers DID report back. The polite channel never delivered it, and the dead-letter was silent — so the orchestrator looked like it was ignoring finished work, when really it never received the knock.

Why the polite channel is the wrong default for report-back

msg is polite to protect a HUMAN's draft. But a --kind done report-back to a creator is exactly the signal the creator must ACT on — deferring it forever defeats the purpose. safe_deliver conflates "a human is typing, protect the draft" with "an agent orchestrator is busy, deliver at the next safe boundary."

Proposed fix (defense in depth)

  1. Escalate report-backs instead of dead-lettering. A --kind done / --kind escalation message to a creator should, after K polite deferrals, fall back to a DRIVING delivery at the next safe boundary (the orchestrator's turn-end is itself a safe boundary) rather than dying silently at 40 attempts.
  2. Never silently dead-letter a report-back. Surface dead-lettered done messages loudly — agentwire doctor flags them, and the orchestrator sees them. A dead-letter that reads as "worker ghosted" is the worst failure mode.
  3. Orchestrator-side pull backstop. Add agentwire worktree --watch (or a review-driver) so the orchestrator can discover finished worktree PRs by polling, never depending on push alone.
  4. Distinguish a human-occupied box from an agent-busy box in safe_deliver, so agent orchestrators get driven at turn boundaries while human drafts stay protected.

Impact

This is the single highest-leverage multi-session reliability fix: without it, autonomous orchestration silently requires constant human prompting. The whole "spawn workers, they report back, you review" loop is only as reliable as the report-back, and today it dead-letters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:bugNon-app work category: bugfeature:sessionsApplication featurepriority:highMust surface above the flat issue list

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions