Repository navigation
fix(first-agent): surface bounded subprocess stderr on failure - #1581
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR includes up to 8 KiB of subprocess stderr in first-Agent failure messages. Example: Docker exits 23 after writing “controller container is unavailable” to stderr.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it provides a focused repair for diagnostic loss still present on main, and repository policy reserves closure for maintainer triage. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe checkout-local first-Agent helper loads the recorded development installation, invokes container-engine and Kubernetes commands through one runner, and returns stdout or prints a failure diagnostic. flowchart TD
A[First Agent command] --> B[Recorded local installation]
B --> C[Shared subprocess runner]
C --> D[Docker or kubectl]
D --> E[Captured process output]
E --> F[Successful stdout]
E --> G[Bounded failure diagnostic]
Technical reviewBest possible solution: Retain bounded failure diagnostics in the existing runner while preserving successful output, credential handling, and subprocess lifecycle. Do we have a high-confidence way to reproduce the issue? Main source directly shows that a subprocess writing stderr and exiting nonzero loses its diagnostic; no target code or tests were executed during this read-only review. Is this the best way to solve the issue? Capturing bounded stderr in the existing shared runner addresses the reported cause without adding another execution path or changing command arguments. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dc895d85e345. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 9, 2026, 10:19 PM ET / October 10, 2026, 02:19 UTC (Revision 2). |
|
Free's clanker here (an AI agent reviewing on Free's behalf). I reviewed dcf83af and approved its CI runs (a local helper script and its test, nothing CI-sensitive). This is a useful fix: an exit code with a generic hint was hard to act on. What I checked:
Non-blocking nits:
Ready to land once |
Problem
Closes #1524. The local first-Agent helper drained subprocess stderr without retaining it, so a failed
dockerorkubectlcommand reported only an exit code and a generic hint.Change
Retain at most 8 KiB of stderr in the existing subprocess runner. On failure, show the captured diagnostic after removing terminal control characters, mark truncated output, and keep the existing hint when stderr is empty. Successful stdout and subprocess arguments are unchanged.
Verification
The startup integration fixture now makes
dockeremit a concrete failure followed by oversized stderr. On the pre-fix source, its new assertion failed because the CLI showed only the generic exit message. With this change, all four startup tests pass; they also cover the empty-stderr fallback, bounded output, and terminal-control removal.node --test tests/integration/first-agent-startup.test.mjs(4 passed)pnpm lintpnpm format:checkpnpm check:workspacepnpm buildgit diff --checkRisks
Verification uses isolated local subprocess fixtures, not a live Docker or Kubernetes installation. The diagnostic is capped and rendered on one line; subprocess timeout and termination behavior is unchanged.
Disclosure: AI was used to understand the codebase and review the fix.