Skip to content

fix(qa): stop lifecycle CI failing on reused PGIDs - #123161

Merged
RomneyDa merged 2 commits into
mainfrom
investigate/qa-pgid-reuse-ci-aug13
Aug 21, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
investigate/qa-pgid-reuse-ci-aug13

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Aug 13, 2026 •

Copy link
Copy Markdown
Member
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Fixes an issue where the QA scenario-command lifecycle test could fail after a clean process-group settlement when concurrent CI reused the released numeric PGID or descendant PID for an unrelated process.

Why This Change Was Made

The real-process regression now treats the lifecycle owner's exact public result as the cleanup proof. A settlement that still observes the original process group records a settlement failure, so the later bare-identity probes duplicated that contract after process identity was no longer owned.

Polling the descendant PID instead would retain the same reuse race and would also misclassify zombie-only cleanup on Linux. Changing production ownership was rejected because production does not perform the failing post-settlement poll.

Best-fix verdict: remove the test-only identity-invalid assertion and its PID-based cleanup fallback while retaining the real inherited-stdio output, leader result, bounded settlement, and absence-of-settlement-failure checks.

User Impact

Maintainers get reliable QA lifecycle CI under concurrent process churn. There is no production or end-user runtime change.

Evidence

  • Fail-first: CI run 31693537276 failed at the current-main-identical test blob in test-file-scenario-command-lifecycle.test.ts:156; its permitted exact-job rerun reproduced the same bare-PGID assertion.
  • Focused Linux proof: Blacksmith Testbox run 31695046127, lease tbx_01kzxdkwm5xm5ekzx8kbap7hz8: 8/8 lifecycle tests passed, including the real inherited-stdio leader/descendant case.
  • Explicit-path changed gate on the same Testbox/run passed formatting, extension-test typecheck, 245-rule lint, plugin boundaries, dead exports, dependency/policy guards, and repository ratchets for the single changed test file.
  • Final rebased-head $autoreview --mode branch --base origin/main: TruffleHog clean, no accepted/actionable findings, patch-correct confidence 0.99.
  • Production LOC: +0/-0. Tests: +3/-9 (net -6). No changelog entry: this is internal test reliability only.

AI-assisted; the implementation, current-main owner path, history, fail-first CI, and validation evidence were inspected directly.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 11:23 PM ET / August 21, 2026, 03:23 UTC.

ClawSweeper review

What this changes

Removes a post-settlement descendant-PID probe and forced cleanup fallback from the QA Lab POSIX lifecycle test.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open. The test-only fix is still needed on current main and correctly relies on the lifecycle owner’s recorded settlement result; it needs refreshed merge-result validation before landing.

Priority: P3
Reviewed head: 087dccd2412c7fb84e346251c8ff22179aa64400

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused, source-consistent test repair is good quality; completion of exact-head merge validation remains the material confidence reducer.
Proof confidence 🌊 off-meta tidepool Not applicable: The PR author is a repository member; its supplied focused real-process result is supporting evidence rather than an external-contributor proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR author is a repository member; its supplied focused real-process result is supporting evidence rather than an external-contributor proof gate.
Evidence reviewed 8 items Current main still has the flaky probe: Current main waits for the descendant PID to die and can signal that numeric PID in cleanup after the lifecycle owner has settled.
The wrapper exposes settlement failure: The lifecycle wrapper incorporates a settlement failure into its returned result, so the changed exact-result assertion fails if the original process group remains alive.
Cleanup owner verifies the original process group: The shared settlement owner records a failure when its authoritative process group remains alive after escalation.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs extensions/qa-lab/src/test-file-scenario-command-lifecycle.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs extensions/qa-lab/src/test-file-scenario-command-lifecycle.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-123161-MsCLey/target$ node scripts/run-vitest.mjs extensions/qa-lab/src/test-file-scenario-command-lifecycle.te
st.ts
node scripts/run-vitest.mjs extensions/qa-lab/src/test-file-scenario-command-lifecycle.test.ts
[test] starting test/vitest/vitest.extension-qa.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-123161-MsCLey/target

 ✓  extension-qa  extensions/qa-lab/src/test-file-scenario-command-lifecycle.test.ts (8 tests) 1669ms
     ✓ settles within a bound after the leader writes its final result with inherited stdio open  427ms
     ✓ reports that a self-detached descendant escaped and cleans it explicitly  1056ms

 Test Files  1 passed (1)
      Tests  8 passed (8)
   Start at  03:24:14
   Duration  3.29s (transform 1.37s, setup 1.12s, import 127ms, tests 1.67s, environment 0ms)

[test] passed 1 Vitest shard in 8.88s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-123161-MsCLey/target$ node scripts/run-vitest.mjs extensions/qa-lab/src/test-file-scenario-command-lifecycle.te
st.ts































Assertions:

  • PASS expect_output: 8 passed

How this fits together

QA Lab launches scenario commands in POSIX process groups, settles their cleanup, and returns captured output plus any settlement failure. The changed test verifies that final result to keep CI reliable under PID reuse.

flowchart LR
A[Scenario command] --> B[Lifecycle wrapper]
B --> C[POSIX settlement owner]
C --> D[Group cleanup verification]
D --> E[Final command result]
E --> F[QA lifecycle test]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind main and exact-head QA checks are still in progress, so landing should use a refreshed merge result.
  • Resolve merge risk (P1) - Reviewer-side structured autoreview could not run because TruffleHog is unavailable.
  • Complete next step (P2) - Await exact-head CI and a refreshed merge-result check; no concrete automated repair is needed.
Agent review details

Security

None.

PR surface

Tests -6. Total -6 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 9 -6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 9 -6

Review metrics

Metric Value Why it matters
Production vs test delta production 0; tests +3/-9 (net -6) The reliability repair removes test-only PID reuse exposure without changing runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase or validate the merge result, then retain the final lifecycle result as the sole proof for original-process-group cleanup while preserving explicit cleanup for deliberately detached descendants.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase or validate the merge result, then retain the final lifecycle result as the sole proof for original-process-group cleanup while preserving explicit cleanup for deliberately detached descendants.

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

Yes. Current source proves that a settlement failure reaches the exact result assertion, while the removed later numeric PID operation can target a reused identity; the PR also reports an exact-head real-process run.

Is this the best way to solve the issue?

Yes. The shared settlement owner already owns verification of the original process group, and the sibling test keeps direct cleanup only where a descendant intentionally escapes that owner.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This PR improves internal QA lifecycle reliability and has no production or end-user behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR author is a repository member; its supplied focused real-process result is supporting evidence rather than an external-contributor proof gate.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Introduced the shared QA POSIX settlement path used as the authoritative cleanup owner. (role: introduced shared settlement behavior; confidence: high; commits: bf0aadbc40c2; files: extensions/qa-lab/src/posix-command-settlement.ts)
  • Peter Steinberger: Authored the current-main predecessor that added the descendant PID assertion and fallback this PR removes. (role: recent lifecycle-test contributor; confidence: high; commits: 0abc5130c975; files: extensions/qa-lab/src/test-file-scenario-command-lifecycle.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete exact-head CI on a refreshed merge result.
  • Run the structured autoreview in an environment with TruffleHog available.

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 (7 earlier review cycles)
  • reviewed 2026-08-14T01:30:53.699Z sha 0b15dce :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T03:10:16.417Z sha 0b15dce :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T05:33:16.318Z sha 0b15dce :: needs maintainer review before merge. :: none
  • reviewed August 15, 2026, 3:51 AM ET / 07:51 UTC sha unknown :: needs maintainer review before merge. :: none
  • reviewed 2026-08-16T09:17:06.069Z sha 93b62b8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-19T11:52:26.314Z sha 93b62b8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-21T02:21:46.500Z sha e1450f4 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 15, 2026
@RomneyDa
RomneyDa force-pushed the investigate/qa-pgid-reuse-ci-aug13 branch from 0b15dce to 93b62b8 Compare August 16, 2026 08:55
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper-recovery-stuck labels Aug 19, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

Rebased onto current main and deliberately reconciled the rewritten descendant-PID assertion at exact head e1450f456e39cea2e153aa6d652c01127569afdb.

Evidence:

  • The lifecycle owner in extensions/qa-lab/src/posix-command-settlement.ts settles only after cleanup completes and reports a settlement failure if the original process group remains alive.
  • The current-main descendant-PID poll had the same numeric identity-reuse problem as the old PGID poll, so the rebased patch removes only that redundant post-settlement probe while preserving current-main's shared PID-file/wait helpers and all escaped-descendant/parent-signal coverage.
  • Production delta: +0/-0. Tests: +2/-4.
  • git diff --check origin/main...HEAD: pass.
  • Autoreview (Codex, branch mode): clean; patch correct 0.99, no actionable findings.
  • Focused local Vitest was attempted but this checkout has no tsx installation (Cannot find module 'tsx'); exact-head CI is the execution proof.

@clawsweeper re-review

@RomneyDa
RomneyDa force-pushed the investigate/qa-pgid-reuse-ci-aug13 branch from 93b62b8 to e1450f4 Compare August 21, 2026 02:17
@clawsweeper

clawsweeper Bot commented Aug 21, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 21, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

Follow-up at 087dccd2412c7fb84e346251c8ff22179aa64400: removed the remaining post-settlement descendant-PID liveness/SIGKILL fallback from the inherited-stdio lifecycle test. A numeric PID can be reused just like the original PGID, so using it in finally could target an unrelated same-user process after ownership ended. The test still synchronizes on descendant startup, asserts the exact owner result (including absence of settlement failure), and retains explicit cleanup coverage for the separate intentionally detached-descendant case.

Proof at this head:

  • focused lifecycle Vitest: 8/8 passed
  • classified check:changed: passed formatting, extension-test typecheck, type-aware lint, plugin boundaries, dead exports, dependency/policy guards, and repository ratchets
  • git diff --check: passed
  • branch autoreview: TruffleHog clean, no accepted/actionable findings, patch-correct 0.99
  • Production LOC: +0/-0. Tests: +3/-9 (net -6)

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa
RomneyDa merged commit 5e00a07 into main Aug 21, 2026
117 checks passed
@RomneyDa
RomneyDa deleted the investigate/qa-pgid-reuse-ci-aug13 branch August 21, 2026 03:31
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 21, 2026
* test(qa): avoid reused PGID lifecycle assertion

* test(qa): drop reused PID cleanup fallback
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

1 participant