Skip to content

fix(qa): retain child output on CLI timeouts - #119524

Merged
steipete merged 1 commit into
mainfrom
codex/qa-memory-doctor-timeout
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-memory-doctor-timeout

Conversation

@steipete

@steipete steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Closes #119385

What Problem This Solves

Fixes an issue where a timed-out QA CLI child was killed without preserving its already-captured stdout or stderr, leaving full-catalog failures unable to identify the stalled phase.

Why This Change Was Made

The central QA child-process owner now keeps a separate bounded stdout tail alongside the existing stderr tail and appends only nonempty diagnostics to the typed timeout error. Successful stdout parsing, the existing 60-second deadline, and cross-platform process-tree termination are unchanged.

The regression coverage includes both deterministic truncation assertions and a real spawned Node child that writes to both streams before timing out.

User Impact

Maintainers running QA Lab can now see the final bounded child output when a CLI step times out, making pressure-sensitive failures diagnosable without raising timeouts or weakening assertions. There is no end-user runtime behavior change.

Evidence

  • Blacksmith Testbox tbx_01kz89e309s68p3pqzrc4msw3h: https://github.com/openclaw/openclaw/actions/runs/30981180209
    • pnpm test extensions/qa-lab/src/suite-runtime-agent-process.test.ts extensions/qa-lab/src/suite-runtime-agent-process.integration.test.ts extensions/qa-lab/src/child-output.test.ts — 41/41 passed.
    • pnpm check:changed — passed, including extension production/test typechecks, 245-rule lint, boundary guards, dead-export checks, and import-cycle checks.
    • OPENCLAW_BUILD_PRIVATE_QA=1 pnpm openclaw qa suite --provider-mode mock-openai --concurrency 8 — 124 passed, 1 failed, 8 skipped. The reported active-memory-preprompt-recall scenario passed under the original concurrency and timeout. The unrelated compaction-retry-mutating-tool scenario reproduced an independent existing failure and is not changed here.
  • AutoReview (gpt-5.6-sol, high reasoning) — clean, no accepted/actionable findings, 0.99 confidence.
  • git diff --check — passed.
  • Public model identifier audit — PASS; the only added model fixture is the repository-standard public openai/gpt-5.6-luna identifier: https://developers.openai.com/api/docs/models/gpt-5.6-luna

AI-assisted: implementation and proof were performed with Codex under maintainer supervision.

@steipete
steipete marked this pull request as ready for review August 5, 2026 06:56
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 3:10 AM ET / 07:10 UTC.

ClawSweeper review

What this changes

The QA Lab CLI subprocess runner retains bounded stdout and stderr tails on timeout and includes available diagnostics in its typed timeout error.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this PR open for the protected maintainer review: it is a focused, correct repair for the linked QA timeout diagnostic loss, with no actionable review findings.

Priority: P2
Reviewed head: b62eb4d21936faf762a94ac528d24d25b9b6be5f

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The patch is narrowly scoped, uses the correct process-owner boundary, and is supported by focused and full-catalog behavior evidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR includes an after-fix Testbox catalog run under the original concurrency and timeout, with the target scenario passing; the included output is suitable CLI proof.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR includes an after-fix Testbox catalog run under the original concurrency and timeout, with the target scenario passing; the included output is suitable CLI proof.
Evidence reviewed 5 items Current-main defect remains: Current main has the same three affected blobs as the PR base; the runner kills the child and emits only the timeout message, although it already collects stdout and a stderr tail.
Owner-boundary repair: The PR-head blobs differ from current main for only the process owner and its two focused tests; the supplied patch adds a separate bounded stdout tail without changing the deadline or process-tree termination.
Existing bounded-output contract: The existing helper owns UTF-8-safe bounded tails, and the existing nonzero-exit path already formats the stderr tail; reusing it preserves the established diagnostic convention.
Findings None None.
Security None None.

How this fits together

QA Lab launches OpenClaw CLI subprocesses while running catalog scenarios. Its process runner captures child output, enforces the deadline, terminates timed-out process trees, and returns a typed failure to the scenario harness.

flowchart LR
  A[QA catalog scenario] --> B[QA CLI process runner]
  B --> C[OpenClaw CLI child]
  C --> D[stdout and stderr capture]
  B --> E{Deadline expires}
  E --> F[Terminate process tree]
  D --> G[Bounded diagnostic tails]
  F --> H[Typed timeout error]
  G --> H
Loading

Before merge

  • Complete next step (P2) - The remaining action is the protected maintainer merge decision; no discrete automated repair remains.
Agent review details

Security

None.

PR surface

Source +15, Tests +65. Total +80 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 17 2 +15
Tests 2 70 5 +65
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 87 7 +80

Review metrics

Metric Value Why it matters
Production versus test delta production +15/-2, tests +70/-5 The net production growth is justified by the process owner retaining diagnostics; focused unit and spawned-child integration coverage account for the larger test delta.

Stored data model

Persistent data-model change detected: serialized state: extensions/qa-lab/src/suite-runtime-agent-process.integration.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #119385
Summary: This PR is the explicit candidate fix for the linked QA timeout report’s missing diagnostic-output symptom.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Land the bounded diagnostic capture at the QA subprocess owner, retaining the existing 60-second deadline and platform-specific process-tree termination behavior.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main retains the timeout path that discards captured output, and the PR adds a spawned-child timeout case; the linked report also records full-catalog occurrences, though this read-only review did not rerun them.

Is this the best way to solve the issue?

Yes. Recording bounded diagnostics in the subprocess owner is the narrowest maintainable repair and reuses the existing tail contract instead of changing timeout policy or adding a downstream workaround.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ae54355087b7.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This repairs a diagnosability failure in the internal QA catalog without changing normal end-user runtime behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR includes an after-fix Testbox catalog run under the original concurrency and timeout, with the target scenario passing; the included output is suitable CLI proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes an after-fix Testbox catalog run under the original concurrency and timeout, with the target scenario passing; the included output is suitable CLI proof.

Evidence

What I checked:

  • Current-main defect remains: Current main has the same three affected blobs as the PR base; the runner kills the child and emits only the timeout message, although it already collects stdout and a stderr tail. (extensions/qa-lab/src/suite-runtime-agent-process.ts:283, ae54355087b7)
  • Owner-boundary repair: The PR-head blobs differ from current main for only the process owner and its two focused tests; the supplied patch adds a separate bounded stdout tail without changing the deadline or process-tree termination. (extensions/qa-lab/src/suite-runtime-agent-process.ts:267, b62eb4d21936)
  • Existing bounded-output contract: The existing helper owns UTF-8-safe bounded tails, and the existing nonzero-exit path already formats the stderr tail; reusing it preserves the established diagnostic convention. (extensions/qa-lab/src/child-output.ts:69, 17ef7771a66d)
  • History and ownership: Blame attributes the current timeout owner to Vincent Koc’s current QA runner path; earlier history introduced bounded child output and process-group termination in the same subsystem. (extensions/qa-lab/src/suite-runtime-agent-process.ts:283, 17ef7771a66d)
  • Real behavior proof: The PR body reports an exact-head Blacksmith Testbox run with 41 focused tests passing, changed checks passing, and the full mock-provider QA catalog at concurrency 8 showing the reported scenario pass under the unchanged timeout. (b62eb4d21936)

Likely related people:

  • vincentkoc: Introduced the current timeout owner and earlier bounded-output/process-group behavior in the QA subprocess path. (role: current process-runner contributor; confidence: high; commits: 17ef7771a66d, 4a2b02e86fc0, 5061a7a741cb; files: extensions/qa-lab/src/suite-runtime-agent-process.ts, extensions/qa-lab/src/child-output.ts)
  • steipete: Has substantial prior history on this runner and child-output area, including timeout and runtime-parity repairs. (role: recent QA-area contributor; confidence: high; commits: b82d8e56b643, 2b3f09659c98, 5ef269c2bbfc; files: extensions/qa-lab/src/suite-runtime-agent-process.ts, extensions/qa-lab/src/child-output.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-05T07:03:16.722Z sha b62eb4d :: needs maintainer review before merge. :: none

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 5, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head b62eb4d21936faf762a94ac528d24d25b9b6be5f.

Root cause: runQaCli already bounded child stdout and stderr, but its timeout branch discarded both captures and emitted only the command name. The QA Lab child-process owner is the canonical repair boundary; scenario-specific doctor changes or a longer deadline would not restore the missing diagnostic fact.

Fix: retain a separate 64 KiB stdout tail beside the existing stderr tail and append only nonempty tails to the typed qa_cli_timeout error. Successful stdout parsing, the 60-second default, and POSIX/Windows process-tree termination remain unchanged. No old path, config, protocol, storage, or migration surface was added. Production delta: +17/-2 (+15 net); tests: +70/-5.

Proof:

Live-proof note: this is maintainer-only QA harness behavior with no external service boundary. The real spawned-child integration test and the built private-QA catalog exercise the affected operator path directly.

@steipete
steipete merged commit ccdfcdf into main Aug 5, 2026
192 of 203 checks passed
@steipete
steipete deleted the codex/qa-memory-doctor-timeout branch August 5, 2026 07:21
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 5, 2026
Punchcard-Session: frost-brook-timber-mx

* origin/main:
  fix: cap local tsgo CPU usage (#119517)
  fix(tool-search): normalize dotted call arguments (#119418) (#119464)
  fix(qa): retain child output on CLI timeouts (#119524)
  fix(discord): preserve authored block order in presentation components (#119506)
  fix: make plugin verification restart guidance install-neutral (#119508)
  fix(qa): preserve profile execution contracts (#119519)
  test(qa): cover managed OTEL runtime paths (#118965)

Punchcard-Session: frost-brook-timber-mx
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
Punchcard-Session: frost-brook-timber-mx

* origin/main:
  fix: cap local tsgo CPU usage (openclaw#119517)
  fix(tool-search): normalize dotted call arguments (openclaw#119418) (openclaw#119464)
  fix(qa): retain child output on CLI timeouts (openclaw#119524)
  fix(discord): preserve authored block order in presentation components (openclaw#119506)
  fix: make plugin verification restart guidance install-neutral (openclaw#119508)
  fix(qa): preserve profile execution contracts (openclaw#119519)
  test(qa): cover managed OTEL runtime paths (openclaw#118965)

Punchcard-Session: frost-brook-timber-mx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Active Memory QA doctor migration times out under catalog concurrency

1 participant