Skip to content

fix(ci): preserve oxlint shard success after graceful drain - #134449

Merged
vincentkoc merged 1 commit into
mainfrom
fix/oxlint-shard-exit-status
Aug 31, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/oxlint-shard-exit-status

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Resolves an intermittent CI failure where a successful oxlint shard could make the release-lint job fail with exit code 1 after every shard had finished and no lint diagnostic was emitted. This occurred when the shard leader exited successfully while a same-process-group descendant was still draining inside the configured cleanup grace period.

Observed failure: https://github.com/openclaw/openclaw/actions/runs/33427356955/job/99604560724

Why This Change Was Made

The shard runner now carries the leader exit status unchanged through the grace period. A naturally drained group preserves success; a descendant that survives the grace period and requires SIGKILL still converts a successful leader status into failure. Timeout, parent-termination, and process-group cleanup-failure behavior remain unchanged.

Owner boundary: scripts/run-oxlint-shards.mts owns shard lifecycle and exit projection. No lint rules, extension code, workflow fanout, or runner-capacity settings change.

Production/tooling LOC: +4/-3. Tests: +88/-1. No obsolete path or compatibility fallback was added.

User Impact

Maintainers no longer get a false-red oxlint job while short-lived descendants finish normally. Real leaked descendants still fail the shard after forced cleanup.

Evidence

  • Regression-first proof: the natural-drain case failed before the production fix with expected 0, received 1.
  • Focused owner suite: 64/64 tests passed.
  • Targeted lead rerun: both new successful-leader process-group cases passed.
  • Changed-scope gate: passed on Blacksmith Testbox tbx_01m1cptqws05w8r47djk6svpmc.
  • Targeted formatting/lint, git diff --check, and changed-check dry run: passed.
  • Fresh Codex autoreview: scoped-clean, confidence 0.98.

The regression table covers both sides of the invariant: natural drain preserves status 0, while a persistent descendant requiring SIGKILL returns status 1 and is confirmed dead.

@vincentkoc vincentkoc self-assigned this Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Aug 31, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 31, 2026 21:08
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 5:33 PM ET / 21:33 UTC.

ClawSweeper review

What this changes

The PR preserves a successful oxlint shard result when its detached process group exits naturally during the configured grace period, while retaining failure after forced cleanup.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

This member-authored, maintainer-labelled PR remains open for normal maintainer handling. The introduced change correctly preserves a zero leader exit only when descendant cleanup completed during grace, while retaining failure when the runner had to force-kill the group; no blocking introduced defect was found.

Priority: P2
Reviewed head: fd80de8aad3b7d4a41260eb20ea1d3a79806710f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with credible regression coverage and no identified correctness or security defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a MEMBER-authored CI tooling repair, so the external-contributor real-behavior gate does not apply; the submitted process-lifecycle regression scenarios are supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a MEMBER-authored CI tooling repair, so the external-contributor real-behavior gate does not apply; the submitted process-lifecycle regression scenarios are supplemental evidence.
Evidence reviewed 6 items Current-main failure path: The base implementation turns a successful leader status into failure before waiting for a still-live descendant group, which matches the reported false-red path.
Owner-boundary repair: The branch records whether SIGKILL was actually required before cleanup, so only forced teardown converts a successful status to failure.
Boundary regression coverage: The new process-based cases cover both outcomes: a descendant that drains during grace returns 0, while a persistent descendant requiring SIGKILL returns 1 and is checked dead.
Findings None None.
Security None None.

How this fits together

Oxlint shard tooling starts detached lint processes for CI and converts their lifecycle outcomes into the release-lint job’s exit status. The changed cleanup path waits for descendants, decides whether forced termination was needed, then reports the final shard result.

flowchart LR
  A[Release-lint job] --> B[Oxlint shard runner]
  B --> C[Detached shard process group]
  C --> D[Graceful descendant drain]
  D --> E{Force kill required?}
  E -->|No| F[Preserve leader status]
  E -->|Yes| G[Fail successful leader]
  F --> H[CI job result]
  G --> H[CI job result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +87, Other +1. Total +88 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 88 1 +87
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 3 +1
Total 2 92 4 +88

Review metrics

Metric Value Why it matters
Lifecycle-state change tooling +1 net; regression tests +87 net The added boolean is the minimal owner-level fact needed to distinguish graceful drain from forced teardown; tests cover both terminal outcomes.

Technical review

Best possible solution:

Keep the cleanup decision at the shard lifecycle owner and merge once the exact-head CI gates complete successfully.

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

Yes: current-main source projects a successful leader exit through a forced-teardown path as failure when descendants are still draining; the branch adds deterministic process-group scenarios for both sides of that condition. The tests were not executed because this review checkout is read-only.

Is this the best way to solve the issue?

Yes: recording force-kill necessity before signaling is the narrow owner-boundary fix. Inferring the result from liveness after cleanup would lose the distinction the reported failure requires.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This fixes an intermittent false-red CI result without changing product runtime behavior.
  • 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: This is a MEMBER-authored CI tooling repair, so the external-contributor real-behavior gate does not apply; the submitted process-lifecycle regression scenarios are supplemental evidence.

Evidence

What I checked:

  • Current-main failure path: The base implementation turns a successful leader status into failure before waiting for a still-live descendant group, which matches the reported false-red path. (scripts/run-oxlint-shards.mts:632, 41ee2cc04f0c)
  • Owner-boundary repair: The branch records whether SIGKILL was actually required before cleanup, so only forced teardown converts a successful status to failure. (scripts/run-oxlint-shards.mts:605, fd80de8aad3b)
  • Boundary regression coverage: The new process-based cases cover both outcomes: a descendant that drains during grace returns 0, while a persistent descendant requiring SIGKILL returns 1 and is checked dead. (test/scripts/run-oxlint.test.ts:563, fd80de8aad3b)
  • Shared process-group contract: The lifecycle helper treats the detached process group as live until its members exit and provides the bounded wait used by the shard owner; the patch does not change that shared contract. (scripts/lib/managed-child-process.mts:167, fd80de8aad3b)
  • Recent area history: Recent committed history identifies Peter Steinberger as an adjacent maintainer of the shard runner before this PR; the supplied local history cannot establish a source-line introducer beyond that routing signal. (scripts/run-oxlint-shards.mts:517, 4ee565c6d2a2)
  • Introduced-scope identity: Host-verified introduction and test-merge evidence limit this PR to the runner’s exit projection and its regression tests; base-only catalog changes are excluded. (scripts/run-oxlint-shards.mts:605, c06f52ff9745)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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-31T21:16:38.880Z sha bf6086bc5d3323dc65057534e7e57889e7811c7a :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the fix/oxlint-shard-exit-status branch from bf6086b to fd80de8 Compare August 31, 2026 21:27
@vincentkoc
vincentkoc merged commit 201f92e into main Aug 31, 2026
163 checks passed
@vincentkoc
vincentkoc deleted the fix/oxlint-shard-exit-status branch August 31, 2026 21:42
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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.

1 participant