Skip to content

fix: remove Windows command startup compilation - #502

Merged
steipete merged 4 commits into
mainfrom
fix/windows-owned-command-bootstrap-20261015
Oct 15, 2026
Merged

steipete merged 4 commits into
mainfrom
fix/windows-owned-command-bootstrap-20261015

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Windows command startup could spend most of its 10-second budget loading PowerShell JSON cmdlets and compiling C#, then leave checkout custody uncertain. Replace per-command compilation with Reflection.Emit native bindings and direct framework JSON serialization. PREPARED gates the first request; possible admission still requires verified Job extinction, helper closure, and drained control output before custody is released. Production startup, execution, and cleanup budgets stay unchanged.

The compiler observer distinguishes command admission from its own instrumentation setup. Its unchanged C# source is a standalone fixture so CodeQL can analyze it after removal of the production C# bootstrap. Native ABI/error mapping, blocked preparation/parsing, cancellation, receipt validation, suspended real-compiler positive/negative controls, and interrupted checkout retry remain asserted.

Validation at 18f6d84:

Residual evidence remains explicit: this PR's Windows HEAD canary failed before pipe connection, during negative-control rescue, and while waiting for observer instrumentation. Those failures are not claimed resolved or attributed to a particular cause. #305 remains open for that cold-start/test-timing investigation. The earlier local Mac run also had three short-budget lifecycle failures, only one reproduced on unchanged main; hosted required Linux/macOS gates passed.

Related: #305. No timeout increase, prewarming, release, tag, version bump, or deployment.

@clawsweeper

clawsweeper Bot commented Oct 15, 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 P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces per-command C# compilation and JSON cmdlet loading with emitted native bindings, framework serialization, and explicit admission receipts.

Example: Windows command preparation exceeds the existing 10000 ms startup budget before any request is issued.

  • Before: An issued request without a terminal receipt leaves cleanup uncertain and retains the Inspector checkout lock.
  • After: The parent can release checkout custody after confirming helper closure when no request was issued.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is coherent and has no definite source finding, but its explicitly required native qualification is absent.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Cold Windows Inspector preparation can time out before its first Git command and retain checkout custody because cleanup cannot be confirmed.
Reason: The maintainer-authored candidate addresses a recorded owned failure through the existing supervisor, without new settings or broader recovery policy; the unresolved investigation correctly remains related rather than closed.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored draft open: it contains distinct work at the Windows command owner, and current main still uses the startup path it replaces; no definite introduced bug was found.

Priority: P2
Reviewed head: 232289d36b7e77a1c523ea84a5fda562c53df742

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Missing native Windows cold-flow execution showing preparation, cancellation and malformed-receipt controls, Job extinction, and interrupted checkout followed by successful retry; the added Windows regressions are not shown failing on base and passing on head.
Agent review details

How this fits together

Crabpot's shared synchronous command supervisor runs checkout, inspection, and security commands; its Windows helper admits native processes into Jobs and returns output, status, and cleanup receipts that govern checkout-lock release.

flowchart TD
  A[Inspector checkout resolver] --> B[Owned command supervisor]
  B --> C[Worker and control pipe]
  C --> D[PowerShell native helper]
  D --> E[Windows Job and command]
  E --> D
  D --> F[Admission and cleanup receipts]
  F --> A
Loading

Technical review

Best possible solution:

Qualify the replacement through the actual cold Windows checkout flow while preserving bounded startup, atomic Job admission, and lock retention whenever cleanup remains uncertain.

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

No deterministic reproduction of the natural cold-start failure is established; the linked investigation records real Windows failures, while this read-only review verified source paths without executing target code.

Is this the best way to solve the issue?

Removing compilation and cmdlet loading at the existing owner is a coherent narrow candidate, but neither source inspection nor separate successful controls establishes that these operations caused the reported stalls.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Repository policy applied: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-notes directory exists. The checkout remained clean, and no target code or tests were executed. (AGENTS.md:1, 232289d36b7e)
  • Distinct replacement absent from main: The pinned introduced diff deletes the C# owner and replaces compilation and ConvertFrom-Json with emitted bindings and framework serialization; current main retains the original compilation path. (scripts/owned-command-windows.ps1:34, 232289d36b7e)
  • Conservative checkout custody: NOT_ADMITTED requires a reported error without admission; terminal receipts are accepted only after helper closure and control-pipe drain. Missing or invalid receipts retain cleanup uncertainty. The manual-recovery contract accepted in fix(inspector): retain checkout lock ownership #397 remains intact. (scripts/owned-command.mjs:481, 232289d36b7e)
  • Investigation remains unresolved: The discussion at Investigate intermittent Windows cold-start failure in command supervisor #305 distinguishes natural cold-start failures from controlled parser cancellation and successful subsequent runs; earlier environment, cancellation, and diagnostic repairs do not establish the natural cause.
  • Qualification explicitly pending: The complete PR body explicitly marks native Windows proof pending and the draft unready to merge; both discussion comments contain review status rather than additional behavior evidence. (232289d36b7e)
  • CI failure attribution unresolved: https://github.com/openclaw/crabpot/actions/runs/38762235093/job/116516243631 reports C# autobuild failure. Its full log redirects to a blocked artifact host, so the available annotation does not establish a diff-caused defect. (232289d36b7e)

Likely related people:

  • Vincent Koc: Raw commit 8b984c0 adds scripts/owned-command.mjs:89 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8b984c058387; files: scripts/owned-command.mjs)
  • Sebastien Tardif: Raw commit 08223ad adds scripts/owned-command.mjs:17 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
Production and test scope Production net -37 lines; tests and fixtures net +232 lines The implementation removes the compiler-based owner; added coverage targets native ABI, cancellation, receipt validation, compiler containment, and checkout retry.

Labels

Label changes:

  • add P2: Intermittent Windows validation startup failures and retained checkout custody warrant a focused repair, without evidence of an urgent core-runtime outage.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Intermittent Windows validation startup failures and retained checkout custody warrant a focused repair, without evidence of an urgent core-runtime outage.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Provide native Windows cold-flow output covering the replacement owner, cancellation and cleanup receipts, and interrupted checkout followed by successful retry.

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.

Reviewed October 15, 2026, 11:53 AM ET / 15:53 UTC.

@steipete steipete changed the title fix: cold Windows commands stall and retain checkout custody fix: remove Windows command startup compilation Oct 15, 2026
@steipete
steipete marked this pull request as ready for review October 15, 2026 18:35
@steipete
steipete requested a review from a team as a code owner October 15, 2026 18:35

@steipete steipete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent P0–P2 review is clean. The required exact-head gate and all CodeQL analyses passed. Native ownership controls passed in the required Windows lane and with identical owner/test source in both Windows lanes of #503. Residual advisory cold-start and fixture-timing failures remain tracked in #305; this approval covers removal of compiler startup work and the verified admission/cleanup protocol, not a claim that every Windows timing failure is resolved.

@steipete
steipete merged commit 9bb9880 into main Oct 15, 2026
19 of 21 checks passed
@steipete
steipete deleted the fix/windows-owned-command-bootstrap-20261015 branch October 15, 2026 18:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T18:39:10.539691Z 18f6d84 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@vincentkoc

Copy link
Copy Markdown
Member Author

Post-merge qualification receipt for head 18f6d84e5b2e09f3476f62ad66695c8062fd3b86: required Windows job https://github.com/openclaw/crabpot/actions/runs/38781124369/job/116582162769 passed the original serial suite (804 tests: 776 pass, 0 fail, 28 skip). Actual ABI/error mapping, preparation/parser cancellation, PREPARED/owner-loss handling, compiler containment positive and negative controls, and preparation-expiry checkout retry executed.

A remaining Windows failure is recorded in the same-head advisory job https://github.com/openclaw/crabpot/actions/runs/38781124149/job/116582064943. Its first capture-contracts.test.mjs process ends with EOWNERSTART: command supervisor startup timed out while resolving the pinned Inspector checkout; the trace reaches helper-spawned. It also fails the blocked-parser negative control rescue assertion and the compiler observer-ready receipt assertion. The workflow aggregate is green because this lane is advisory; that does not establish a clean Windows result.

Follow-up: reproduce that cold original order with the existing startup/cleanup budgets and retain admission/closure truth for the failed surface. No timeout increase, weaker assertion or retry is proposed from these logs. The landed startup/custody repair and its required-suite proof remain distinct from this unresolved advisory behavior. No release operation was performed.

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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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.

2 participants