fix-chat-tab

Fix: chat tab should surface spawn errors when the chat agent dies, not fall back to coordinator

Metadata

Statusdone
Assignedagent-1281
Agent identity3184716484e6f0ea08bb13539daf07686ee79d440505f1fdf2de0357707034c3
Modelclaude:sonnet
Created2026-04-30T16:18:16.900199167+00:00
Started2026-04-30T16:34:55.852865323+00:00
Completed2026-04-30T17:05:47.058540994+00:00
Tagspriority-high,fix,tui,ux,chat, eval-scheduled
Eval score0.85
└ blocking impact0.88
└ completeness0.80
└ constraint fidelity0.85
└ coordination overhead0.93
└ correctness0.85
└ downstream usability0.82
└ efficiency0.85
└ intent fidelity0.80
└ style adherence0.88

Description

Description

When a chat agent process dies (any handler — claude / codex / nex), the chat tab silently falls back to showing 'chat with the coordinator' or similar generic placeholder. The user has no way to know:

  • That the chat agent died (vs. is just slow)
  • Why it died (exit code? stderr output? endpoint unreachable?)
  • Whether to retry / fix config / abandon

User report 2026-04-30: 'I just tried to get wgnex to use qen3 coder, and it just immediately died. No error messages, nothing. Just immediate death... it's now saying chat with the coordinator. Because after it dies, that's what it says. It should actually be showing me the error messages that came out.'

Spec

When a chat agent process dies, the chat tab should:

  1. Stay on the chat task (don't auto-switch to coordinator)
  2. Display in the chat content area:
    • Bold red 'Chat agent died' header
    • Exit code (if captured)
    • Tail of stderr (last ~50 lines or full output if shorter) — if captured
    • The IPC params used to spawn (model, executor, endpoint)
    • Actionable hint: 'Press R to retry with same config' / 'Press E to edit config in launcher dialog' / 'Press X to close this chat'
  3. Send no further input to the dead PTY
  4. Optionally, log a summary entry to wg log recording the death event (so future inspections see it)

If stderr was NOT captured (nex stderr currently unrouted per diagnose-nex-spawn — separate task), the tab should at minimum say 'stderr was not captured for this handler — see daemon.log for details' rather than blank silence.

Validation

  • Failing test: kill a running chat agent process directly (kill -9 ); chat tab shows 'died' message with exit info — does NOT fall back to coordinator
  • Live smoke: spawn a nex chat with bogus endpoint (e.g., http://nope.invalid:9999); confirm chat tab shows the connection failure, not silence
  • Live smoke: bound test with claude/codex — same death-handling UX across handlers
  • Retry hotkey actually retries with the same params
  • cargo build + cargo test pass
  • cargo install --path . was run before claiming done

Process note

This depends on diagnose-nex-spawn-silent landing first if nex's stderr is currently unrouted. The fix here is the UX surfacing layer; if there's nothing to surface, surfacing infrastructure won't help. Coordinate the order: diagnose first, fix stderr-capture second, then this UX fix consumes the captured data.

Depends on

Required by

Log