fix(cli): print failures as a recoverable summary line

Merged
TH
14h ago
+1353-288

Summary

Agents keep head -1 or tail -1 of merged output. Today tail -1 keeps the diagnostics footer, and "Retry with --debug" re-sends taps that may have landed. A failure now prints one summary line, first and last:

Error (COMMAND_FAILED): tap @e12 timed out. May have reached the device. Next: Run snapshot to check the screen before you retry. Read the diagnostics log for the failing step.
Log: …/requests/<id>.ndjson
Error (COMMAND_FAILED): tap @e12 timed out. May have reached the device. Next: Run snapshot to check the screen before you retry. Read the diagnostics log for the failing step.
  • The dispatch fact comes from typed details.dispatched; the snapshot-first step is added at print time.
  • Two or three ambiguous candidates go inline. INVALID_ARGS appends the command synopsis.
  • No hint asks for a --debug rerun. Client transport failures disclose dispatch via a registry helper shared with the daemon. The log path stays visible; the diagnostic id is dropped from human output. --json/MCP keep their shape; default hint text and details.dispatched values change, and details.daemonSocketRequestWritten becomes daemonRequestSent.
  • ADR 0010 amended. 50 files. Supersedes #4295.

Pre-dispatch refusals (DEVICE_NOT_FOUND, DEVICE_IN_USE, selector AMBIGUOUS_MATCH) now disclose dispatched: no. Eval: docs/evidence, 100% recovery vs 58%.

Validation

  • pnpm check:affected --run --head 97fd70bf44: 42 passed, 25 skipped, exactCommit=true.
  • Reviews addressed. Live progress and --debug output can precede the first line (ADR 0010).
  • Cubic and Apex Sentinel threads: answered and resolved (two declined with reasons).

šŸ¤– Generated with Claude Code