Skip to content

fix(ci): preserve Windows bootstrap failure diagnostics - #541

Merged
vincentkoc merged 3 commits into
mainfrom
fix/windows-owner-bootstrap-diagnostics-20261019
Oct 19, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
fix/windows-owner-bootstrap-diagnostics-20261019

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Windows supervisor startup failures can lose the information needed to distinguish helper entry, pipe connection, and early preparation failure. The PowerShell error path currently depends on a pipe writer and serializer that may not exist yet, and callers that throw result.error discard separately returned helper information. This change repairs that diagnostic boundary; the original EOWNERSTART startup cause remains UNKNOWN.

Related failures: Nostr #517 (Windows job) and Voice Call #518 (Windows job). These links provide context; this PR does not claim to fix either startup failure.

Change

  • The Windows helper emits a fixed-schema, capture-only channel for script entry, connection attempt, connection completion, and pre-serializer failure. Pipe construction is inside the early failure boundary. Diagnostics use fixed categories and numeric native facts, without exception messages, arguments, environment values, paths, or pipe tokens in the public result.
  • The canonical command supervisor validates and bounds helper observations to four events, transports them from Worker to parent, and attaches available observations and observed terminal state to the returned failure Error. Missing observations remain unknown. Inherited output and successful result shapes remain unchanged.
  • Ordinary stderr remains under the existing combined capture budget. Idempotent finalization on stream end, premature closure, and before the completion snapshot preserves a pending ordinary tail exactly once; overflow still produces ENOBUFS and preserves the first failure.

No deadline, heap limit, phase allowlist, request-admission rule, target execution order, Windows Job ownership, or cleanup policy changes. No retries, execution fallback, dependency changes, or plugin-specific masking.

Production: +144 / -11, net +133 lines. This growth supplies previously unavailable bounded producer facts and preserves them across the existing ownership boundary; it does not add another execution path. Tests: +181 lines. Documentation/changelog: +19 lines.

Validation

  • Trusted, dependency-free focused proof on macOS / Node 26.7.0: 20 passed, 0 failed; 7 Windows-only tests skipped. Coverage includes combined capture limits and first-error precedence, malformed/ordinary stderr framing, actual Readable destruction without end on both sides of completion, Worker serialization, and caller-throw preservation.
  • Syntax checks passed for the command owner and both touched test files; git diff --check passed.
  • Independent broad source review accepted the final patch, including the corrected premature-closure regression. Canonical independent autoreview completed with no findings at its P0-only threshold; that result does not imply a broader severity verdict.
  • Historical native Windows proof, head fce7f1170c8fa5615f83913844da30c8ca519af9: the required Windows job and required Default Track aggregate passed. The recorded component evidence covers the four real-PowerShell early-failure cases, inherited output, framing, Worker transport, cancellation controls and retained resolver/contention checks. It does not establish the specific native resolver-expiry result. These results cover that historical head; the later 5633edd6 qualification is recorded below.

Source: signed commit fce7f1170c8fa5615f83913844da30c8ca519af9, based on cfe442dd122850bafbe11e1a4db3d2278a34694f; reviewed six-file diff SHA-256 a47118bf9ee17d17cbd2c05f6bd0f07a98abb01a33ab52c8d86e786b62c28274.

No release, deployment, package publication, or service change is requested or authorized.

Completed qualification of 5633edd6

Signed merge 5633edd6f6a7aa8b58e1925243fd445d10423542 integrated frozen main de5d707b4a2cf864522c7689017c170bfc577fc1, preserving the accepted four runtime/test blobs and both sides of the README/changelog documentation. Its six-file PR diff was 31,266 bytes, SHA-256 6349276c87ad31c75342c94cf585b788fc1cf508389005121f23ea2a2d12c2fc. Syntax checks, independent composition review and the one-pass P0-only canonical full-PR static review passed.

The required Default Track aggregate passed on that exact head at 13:22:26 UTC. All four required OS/container lanes passed. The required native Windows job passed at 13:22:20 UTC.

Optional Windows rank-up move applied at 5633edd6: the completed Windows job directly confirms the four real-PowerShell early-failure cases (captured pipe construction, connection and preparation; inherited-output pipe construction), bounded framing and Worker-to-Error preservation, both cancellation controls, and retained checkout/resolver/contention assertions. It also passes “Windows preparation expiry releases only a nonadmitted checkout before the next resolver” (13,531 ms). This resolves the previously unclaimed resolver-expiry result for that head. These are component/owned-process assertions, not reproduction or attribution of the original intermittent startup failure.

Current integration qualification

Signed merge a875c69b490f4a0fba029d8c90a873f89e4273d7 integrates frozen main 368a54f398e4ebb07f86b29d34c623d5456d050c with ordered parents [5633edd6f6a7aa8b58e1925243fd445d10423542, 368a54f398e4ebb07f86b29d34c623d5456d050c], tree 140e082b566917be351167ce462be6b9de1675ee. The new main commit only updates the generated dashboard and reports. The merge is conflict-free; all 17 generated report blobs remain exactly main's, and all four runtime/test blobs remain exactly the accepted and passing 5633edd6 bytes. All main documentation and the diagnostic additions remain intact.

  • Current six-file PR diff: 31,266 bytes, SHA-256 31479df21dc4878aa2c38a43319afc32631237f83d7fe5b91a518a6ae164828f. Compared with the accepted prior PR patch, only the README blob-index metadata changes; the complete patch text and production/test/documentation allocation are unchanged.
  • Syntax checks for the command owner and both test files, plus git diff --check, passed. Independent integration review accepted the signed ordered parents, exact source/doc composition and preserved main reports.
  • Current canonical full-PR static review against frozen main completed in one pass with no findings at its P0-only threshold. It did not execute repository code or independently verify current-head Windows runtime behavior.
  • Current-head qualification passed for a875c69b. Required Default Track run 39267880129 completed successfully; its strict aggregate 118220839773 passed at 18:05:05 UTC. All four required OS/container lanes passed, including native Windows 118112130250 at 18:04:59 UTC. Current ClawSweeper revision 3 covers this exact head with no findings, no before-merge item and no remaining Rank-up moves. The completed 5633edd6 CI remains historical supporting evidence.

The three advisory host-corpus jobs at 5633edd6 failed with V8 heap exhaustion at test/corpus/host.test.mjs against OpenClaw 43e2d3ce2e9bafc5172b65a3d7c0b0a77fb78b6e. Those advisory failures and the original startup/runner-loss causes remain unresolved; this diagnostics PR does not claim to fix them. No timeout, heap, dependency or execution-policy change is included.

Current-head advisory results remain separate: all three OS jobs in advisory run 39267880326 failed with explicit V8 heap-exhaustion messages against OpenClaw e055783d9f99624b76edfc6d47e6b313a9b75ed3 on Node 24.21.0. The current-head Windows advisory job directly passed the four real-PowerShell early-failure cases, bounded framing/tail and Worker-to-Error transport, both cancellation controls, and resolver expiry (13,534 ms) before that separate OOM. The precise allocation cause remains unknown; these failures do not establish a startup or runner-loss fix, and no heap/timeout adjustment is included.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves bounded Windows bootstrap observations and helper terminal state on returned command errors.

Example: The Windows helper fails while constructing its named pipe.

  • Before: The caller receives EOWNERNATIVE without structured evidence identifying pipe construction as the failed stage.
  • After: The returned Error retains failure.stage='pipe-create', kind='argument', exitCode=1, and requestIssued=false.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with native component evidence, but no shipped-entry-point demonstration.
Proof confidence 🦐 gold shrimp (3/6) This member-authored PR is outside the ordinary contributor proof gate; its recorded native Windows component qualification covers unchanged runtime/test bytes, and the previous optional assertion check is recorded as completed. Current-head CI remains pending; raw historical logs were blocked by the sandbox redirect.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Windows command failures can reach caller logs without evidence distinguishing helper entry, connection, and preparation failure.
Reason: The maintainer-authored direction provides bounded missing facts at the shared owner and explicitly leaves the underlying intermittent failure unresolved.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs a verified diagnostic gap still present on main, with no actionable correctness findings; it remains draft with current-head required checks pending.

Priority: P2
Reviewed head: a875c69b490f4a0fba029d8c90a873f89e4273d7

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence exercises native component faults rather than a shipped CLI failure; a base-fail/head-pass execution is not shown.
Agent review details

How this fits together

The shared command supervisor runs checkout, audit, and inspector commands through a Worker and Windows PowerShell helper, returning captured output, command errors, and cleanup receipts to callers.

flowchart LR
  A[Checkout and inspector callers] --> B[Synchronous command owner]
  B --> C[Worker supervisor]
  C --> D[PowerShell helper]
  D --> E[Owned target process]
  D --> F[Bounded bootstrap observations]
  F --> C
  C --> B
Loading

Technical review

Best possible solution:

Land the bounded diagnostics through the existing supervisor while retaining the separate investigation into intermittent startup failures.

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

Main constructs the pipe outside its error boundary and cannot report pre-serializer failures through its existing control channel; the intermittent startup trigger itself remains unknown.

Is this the best way to solve the issue?

The patch repairs the diagnostic producer and preserves its observations through the existing Worker and Error owners without changing execution policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 368a54f398e4.

Provenance checked

  • Shared command ownership and output capture keeps the original intent (08223ad: Bound command execution and descendant cleanup while preserving synchronous results and combined output limits.)
  • Startup observations and Error propagation keeps the original intent (8b984c0: Expose bounded startup facts without changing admission, deadlines, first-error precedence, or cleanup receipts.)
  • Windows preparation and request gating keeps the original intent (9bb9880: Remove per-command compilation and gate requests on PREPARED while preserving explicit cleanup custody.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Repository policy applied: Read the complete root AGENTS.md; no nested AGENTS.md files govern the changed paths, and no maintainer-notes directory or pr-simplify skill is present. The change preserves fixture ownership and credential-free default checks. (AGENTS.md:1, a875c69b490f)
  • Verified introduced change: The pinned main-to-head diff contains only the six declared files; main lacks the bootstrap capture channel and Error attachment. (scripts/owned-command.mjs:169, a875c69b490f)
  • Early failure boundary: Pipe construction now occurs inside the existing try boundary; fixed bootstrap facts can be emitted before the control writer and serializer exist, while inherited output disables capture. (scripts/owned-command-windows.ps1:35, a875c69b490f)
  • Existing callers retain diagnostics: Checkout callers throw result.error directly or preserve it as cause, so attaching observations to that Error reaches the existing failure-reporting boundary. (scripts/plugin-inspector-source.mjs:198, a875c69b490f)
  • Prior qualification retained: The runtime and test files are byte-identical to the previously reviewed head. GitHub confirms its required Windows job succeeded; the maintainer records four early-failure cases, cancellation controls, and resolver expiry. Raw job logs redirect to a sandbox-blocked Azure host, so their individual assertions were not independently reread. (test/owned-command.test.mjs:302, a875c69b490f)
  • Current workflow state: GitHub reports the reviewed head as draft and mergeable, with required OS/container checks still running; pending checks establish no diff-caused failure. (a875c69b490f)

Likely related people:

  • Sebastien Tardif: Raw commit 08223ad adds scripts/owned-command.mjs:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 08223ad0230d; files: scripts/owned-command.mjs)

Review metrics

Metric Value Why it matters
Change allocation Production +144/-11; tests +181; documentation +19 Growth implements bounded producer observations, framing, and transport in existing owners; tests cover distinct failure and output-preservation boundaries.

Root-cause cluster

Relationship: partial_overlap
Canonical: #305
Summary: The startup investigation owns the unresolved intermittent failure; this PR addresses a narrower diagnostic gap.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Missing Windows startup diagnostics hinder CI investigation, without evidence of an urgent runtime outage caused by this patch.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-19T04:48:38.529Z sha fce7f11 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-19T09:50:57.464Z sha 5633edd :: needs maintainer review before merge. :: none

Reviewed October 19, 2026, 10:23 AM ET / 14:23 UTC (Revision 3).

@vincentkoc

Copy link
Copy Markdown
Member Author

Follow-up: Windows profiler descendant-cleanup proof

Six earlier Windows jobs (#538, #520, #522, #524, #532, #523) recorded hosted-runner communication loss during the static latest track; #538’s Windows job is one example. No cause or failed-test exception was established.

The shared command supervisor’s Job scope has no observed upward runner-kill route. There is no configured three-hour cutoff. No timeout, heap, concurrency, or source change is justified as a runner-loss fix.

Inspector at 8f458e7be92258ac1729451a0a4bcaea2ecdb68e explicitly kills its Windows child and checks the leader, without a per-sample native descendant-extinction receipt. Node/libuv also supplies implicit Job cleanup, so an actual descendant leak is not established.

The follow-up oracle must exercise the actual runtime profiler: a leader leaves a descendant with retained or closed pipes; require extinction before the next sample or rescue, while an unrelated sentinel and parent survive. Preserve the original campaign order.

This PR adds bootstrap diagnostics; it is not a proven runner-loss fix. Native current-head CI qualification remains pending.

@vincentkoc

Copy link
Copy Markdown
Member Author

Native Windows component proof is now available for unchanged head fce7f1170c8fa5615f83913844da30c8ca519af9 in canary job117891935718. Static step3 completed successfully. All four new real-PowerShell pre-serializer cases passed: captured pipe-create, pipe-connect and preparation failures, plus inherited-stdio pipe-create failure. Framing, premature-stream-close preservation and Worker error transport also passed. Existing preconnection/late-connection cancellation controls passed with helper closure before rescue; three retained resolver/contention checks passed. The specific native resolver-expiry result is not claimed here. The compiler lifecycle’s four controls and two refusal cases passed, with final Worker exit0 and no errors.

The advisory job subsequently failed in static step4, test/corpus/host.test.mjs, with explicit V8 heap exhaustion. Runtime profiling was not reached. This establishes scoped native component proof, not required-CI completion or resolution of the original EOWNERSTART or runner-communication failures. Required CI remains pending; original causes remain unknown.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review current head 5633edd6f6a7aa8b58e1925243fd445d10423542 against main de5d707b4a2cf864522c7689017c170bfc577fc1. This signed integration retains the accepted four runtime/test blobs and both documentation changes. Fresh required CI is running; the PR remains draft. Historical Windows evidence and current qualification limits are separated in the updated body.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 19, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head a875c69b490f4a0fba029d8c90a873f89e4273d7 against frozen main 368a54f398e4ebb07f86b29d34c623d5456d050c. This signed refresh retains the accepted diagnostics code/test bytes and main's generated reports. The body records the completed prior-head Windows assertions, including resolver expiry, and separates them from the new head's pending required CI. No repair, merge, release or deployment is requested.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 19, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 19, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 19, 2026 18:10
@vincentkoc
vincentkoc requested a review from a team as a code owner October 19, 2026 18:11
@vincentkoc
vincentkoc merged commit dd797d0 into main Oct 19, 2026
25 of 28 checks passed
@vincentkoc
vincentkoc deleted the fix/windows-owner-bootstrap-diagnostics-20261019 branch October 19, 2026 18:11
steipete added a commit that referenced this pull request Oct 19, 2026
Preserve the owner-landed Windows diagnostics from #541 and both adjacent Unreleased entries. Independent Codex review of the combined candidate found no actionable P0-P2 defects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant