Repository navigation
fix(qa): retain bootstrap diagnostics after timeouts - #136111
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 4:40 AM ET / 08:40 UTC. ClawSweeper reviewWhat this changesThe PR preserves bounded, redacted QA child-process diagnostics after timeout, cancellation, and stream/process failures, and distinguishes repair-help failures from repair failures. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep this PR open. Current main still drops captured diagnostics after early CLI failures; the branch repairs that owner boundary without a blocking correctness or security issue, while exact-head CI is still in progress. Priority: P2 Review scores
Verification
How this fits togetherQA Lab starts isolated OpenClaw CLI child processes during bootstrap and packaged setup checks. It captures their output, settles the child lifecycle, and returns bounded redacted diagnostics to QA operators. flowchart LR
A[QA bootstrap or setup] --> B[CLI child process]
B --> C[Captured stdout and stderr]
C --> D[Lifecycle shutdown and pipe drain]
D --> E[Redacted bounded error]
E --> F[QA operator diagnostics]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +59, Docs +3. Total +66 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Land this owner-level repair after its exact-head CI is green, retaining the existing redaction, output bounds, lifecycle settlement, and successful-output behavior. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main’s early-failure condition bypasses captured-output formatting, and the new real-child fixture targets all affected failure origins. The checkout was read-only, so I did not execute it. Is this the best way to solve the issue? Yes. The fix belongs in the existing command owner after its existing settlement and pipe drain, and it reuses the canonical bounded redactor rather than adding a parallel capture path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cc6769b89216. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Retain bounded, redacted stdout and stderr after QA CLI timeout, cancellation, and process or stream failure settlement. Preserve the first failure reason and distinguish packaged repair-help from repair failures. Diagnostic-only repair for #136102. Execution deadlines, cleanup, successful output, and capability negotiation remain unchanged; this does not fix the underlying bootstrap timeout or pending-notice UI behavior.
0e59812 to
020d368
Compare
|
Land-ready maintainer verification for Exact-head CI 33609123436 completed successfully; the required The latest ClawSweeper review, reviewed at 08:40 UTC on this head, has no correctness/security findings and no before-merge items. Its earlier refresh/green-CI Rank-up move is complete. Production net +4 is accepted for reusing the final command formatter and distinguishing setup phases. The stored-data classification is inapplicable: no auth/store/schema/migration/argument behavior changed. Observed proof:
Local commands: node scripts/run-vitest.mjs extensions/qa-lab/src/gateway-child-bootstrap.test.tsnode scripts/run-vitest.mjs extensions/qa-lab/src/gateway-child.test.ts --testNamePattern 'blocks packaged gateway spawn with bounded redacted diagnostics'node scripts/run-vitest.mjs extensions/qa-lab/src/gateway-child-bootstrap.test.ts extensions/qa-lab/src/gateway-child.test.ts extensions/qa-lab/src/gateway-child-lifecycle.test.ts extensions/qa-lab/src/gateway-log-redaction.test.ts extensions/qa-lab/src/child-output.test.tsnode scripts/check-changed.mjs --base HEAD -- extensions/qa-lab/src/gateway-child-command.ts extensions/qa-lab/src/gateway-child-setup.ts extensions/qa-lab/src/gateway-child-bootstrap.test.ts extensions/qa-lab/src/gateway-child.test.ts docs/concepts/qa-e2e-automation.mdThe supplemental local Node 26 SDK sweep was intentionally stopped after approximately 19 minutes and is incomplete, not passing proof; hosted Linux CI supplies that fixture validation. No successful packaged install, live provider, original UI bootstrap, or cross-platform campaign is claimed. The original timed-out invocation and existence of nonempty output in that attempt remain unknown. This is the owner-level diagnostic fix: first reason plus available stderr/stdout after existing settlement/drain through the canonical redactor. The 120-second deadline, capture bounds, cancellation, cleanup, success output, and setup capability negotiation remain unchanged. It does not claim to fix the underlying bootstrap timeout or pending-notice UI bug. Proceeding through repository-native prepare/merge only. |
|
Merged via squash.
|
Retain bounded, redacted stdout and stderr after QA CLI timeout, cancellation, and process or stream failure settlement. Preserve the first failure reason and distinguish packaged repair-help from repair failures. Diagnostic-only repair for openclaw#136102. Execution deadlines, cleanup, successful output, and capability negotiation remain unchanged; this does not fix the underlying bootstrap timeout or pending-notice UI behavior.
Closes #136102 — QA bootstrap drops captured diagnostics on timeout and earlier failures.
What Problem This Solves
Fixes an issue where QA operators would lose useful child stdout/stderr when bootstrap or a post-start CLI command timed out, was cancelled, or failed through a process/stream error. Installed-package plugin setup also reported the same failure prefix for
update repair --helpand the actual repair, hiding which phase failed.Why This Change Was Made
Finalize the diagnostic in the existing CLI command owner after process-tree settlement and bounded pipe draining, preserving the first failure reason and appending captured stderr then stdout through the canonical redactor. Let the existing private bootstrap wrapper return its operation result so help and repair can have separate fixed phase labels; no raw argv/environment logging or parallel logging path is added.
Lifecycle ownership, admission/cancellation, cleanup aggregation, successful stdout, capability-consent negotiation, the 120000ms execution deadline, and the 1000ms drain deadline are unchanged. The existing 2048-character redacted error bound, stdout 1MiB cap, and stderr 64KiB tail are unchanged. No configuration, dependency, schema, protocol, or test-only production seam is added.
This repairs diagnostic loss only. The original isolated UI setup's timed-out invocation is unknown; nonempty output in that attempt was not established. Neither the underlying bootstrap timeout nor the pending-notice UI bug is claimed fixed. Separate scenario-command diagnostic gaps use different result/settlement owners and were recorded as follow-up work rather than bundled here.
User Impact
QA failures retain meaningful sanitized diagnostics, including output emitted during shutdown, while preserving the earliest failure reason and normal cleanup. Packaged setup errors identify the repair-help probe or actual repair. QA overview documentation describes the diagnostic behavior.
Production LOC: +27/-23 (net +4). Tests: +74/-15 (net +59). Docs: +4/-1. The small production increase buys final output retention and phase-specific attribution by reusing the existing owners; no alternative runtime flow was introduced.
Evidence
Failing before, passing after
The extended existing real-child fixture writes meaningful synthetic diagnostics to both pipes and hangs. The parent observes both streams before injecting failures. Timeout uses the existing fake-timer control; child spawning, output, descendant liveness, termination, and cleanup remain real.
Pre-fix: 6 expected diagnostic failures, 8 passes. Post-fix: 14 passes. Coverage includes timeout, cancellation, stdout, stderr, stdin, process errors, first-failure precedence, shutdown-emitted output, redaction, workflow-command neutralization, the 2048-character bound, and removal of raw argv/env/stdin/cause/error-graph data.
node scripts/run-vitest.mjs extensions/qa-lab/src/gateway-child.test.ts --testNamePattern 'blocks packaged gateway spawn with bounded redacted diagnostics'Pre-fix: 2 expected phase-label failures, 2 passes. Post-fix: 4 passes. Help and repair are now independently attributed; auth phase labeling and canonical-config behavior are unchanged.
Owner and sibling coverage
138 passed, 1 skipped on macOS/Node 24.20.0. The skipped case is Linux-only. Existing coverage includes overlapping post-start commands, successful leader exits with descendants, cleanup failures/retries, artifacts, legacy capability-help behavior, output byte bounds, and redaction.
Real-clock timeout proof
A separate source-owner probe launched an isolated synthetic Node child, emitted stdout/stderr, and waited for the unchanged real deadline without fake timers or a timeout override. It completed at 120052ms with a 2048-character error containing both sanitized diagnostic markers, no raw secrets/argv/environment data, and confirmed-stopped cleanup. Its isolated temporary directory was removed.
This is real child-process boundary proof, not proof of successful packaged installation, a live-provider run, or the original UI bootstrap. No UI rendering changed, so there is no before/after UI capture.
Static checks and review
Passed: production/test type checks, targeted lint/format, doctor contract tests (5 passed), plugin boundaries, dead exports, import cycles, and selected guards. The first check attempt found missing browser parser types already declared by refreshed main;
pnpm installrefreshed the stale install, and unchanged checks then passed. No manifest/lockfile edits.Independent Codex autoreview: scoped-clean at the default P0 threshold. The lead separately inspected the full command/setup/lifecycle/capture/redaction owners, callers, tests, docs, current main, raw historical patches, and Node's exit/close contract.
git diff --checkpassed. Full-suite, package, provider, and cross-platform campaigns were not run for this diagnostic-only owner change; hosted exact-head CI is the remaining landing gate.Maintainer review follow-through
The current ClawSweeper review found no correctness or security findings and judged this the owner-level fix. Its remaining items are addressed as follows:
gateway-child-setup.tschange returns a private helper's existing operation result and splits fixed error labels. Auth configuration, capability detection, repair arguments, persistence operations, representations, and migrations are unchanged. No schema/store change or new upgrade step exists to migrate. Existing auth/config, legacy-help, retry, and lifecycle tests passed.The refreshed 08:05 UTC review adds a Rank-up move: refresh onto current main and obtain green exact-head CI. The mechanical refresh below incorporates the canonical fixture fix; the new exact-head CI result remains mandatory before merge. No additional diagnostic source change is requested by the review.
CI correction
Initial exact-head CI 33603899100 failed in
checks-node-compact-small-49: the unrelatedwrite-plugin-sdk-entry-dts.test.tscache-relocation fixture expected a historical root chunk that it had not seeded. The actual tested merge used main parent331d8a2265ff07d5db51e459c32d38c10fc7dc24.Main subsequently fixed that premise in 5e6117d17d92 — scoped external channels and CI fixture repair. The fixture now pre-seeds only unowned historical chunks from the current snapshot, while cache-owned outputs must still be restored and the complete tree must remain byte-identical. The diagnostic patch was mechanically rebased onto
4fc24e6e0f81121cef0fb4395db29fb87700e7f6, which contains that fix. Range-diff and patch hashing confirm the same five-file patch, byte-for-byte. No duplicate fixture patch, assertion weakening, timeout increase, or CI bypass was added. Prepare/merge were not invoked on the failed head.Rebased head:
020d3683c1828ff2d56a3b1d658817008f550aa7. The focused bootstrap suite passed 14/14 again on Node 24.20.0, and fresh branch autoreview was scoped-clean at P0. The previous complete changed checks and 138-test owner/sibling proof apply to the identical repair; fresh hosted exact-head CI remains required before merge.A supplemental local SDK sweep on Node 26.8.1 reported three passing cases but was explicitly interrupted by the maintainer after approximately 19 minutes; it has no cache-relocation verdict and is not passing proof. A concurrently started QA retry was also stopped, then replaced by the completed 14-test Node 24.20.0 run above. The canonical upstream fixture was verified by the new exact-head Linux CI run, not by treating the interrupted sweep as success.
Final exact-head validation
CI run 33609123436 completed success for
020d3683c1828ff2d56a3b1d658817008f550aa7; the requiredopenclaw/ci-gateis SUCCESS. The previously failingchecks-node-compact-small-49shard passed with the inherited canonical fixture correction. The native CI watcher completedGREEN, and native review artifacts validate for this exact head.The latest ClawSweeper review at 08:40 UTC covers this head, reports no correctness/security findings and no before-merge items. The prior refresh-and-green-CI Rank-up move is completed. The stored-data classification remains inapplicable for the unchanged persistence contract, as explained above. All remaining proof limitations are unchanged; this is ready for repository-native prepare/merge, not a claim that the original bootstrap timeout or UI bug is repaired.