fix(pi-subagent): meaningful wait failures, 30m default timeout, resume after timeout
Three production-observed defects (156 tool errors in 14 days of live use): 1. Wait/final delivery threw the delivered text as the error. For output_mode:'file-only' runs the entire failure became 'Output written to /tmp/x.md'; for empty outputs '(no output)' — the actual failure reason was lost. Failures now lead with run state + per-task error summaries (composeRunFailureMessage), with the delivered payload trailing as context. 2. Default run timeout was 15m; three general-profile runs were killed mid 'git commit'/'gh pr create'. Default is now 30m, still configurable via ~/.pi/subagent.json defaultTimeoutMs / PI_SUBAGENT_TIMEOUT_MS. Explicit timeout_ms behavior unchanged. 3. Resume of a timed-out child failed in ~1s with only 'Subagent exited with code 1'. Root cause: pi-subagent handed pi a bare session id, which pi resolves via a cwd-filtered lookup that falls back to a global search with an interactive stdin prompt — fatal in rpc mode. Bare ids are now resolved to their session file under sessionDir before launch (missing file fails fast with an actionable error), and nonzero-exit failures now include the stderr tail (e.g. 'No session found matching ...') so future failures are diagnosable.
L
Luke Parke committed
55adeed3d9817ff46237c9961b1b2972b68f3258
Parent: 86f15cf