Skip to content

fix(ci): restore direct AWS dependency hydration - #118604

Merged
vincentkoc merged 2 commits into
mainfrom
fix/aws-hydrate-typescript-resolution
Aug 3, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/aws-hydrate-typescript-resolution

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Related: #116783

What Problem This Solves

Fixes an issue where direct AWS Crabbox validation would fail during dependency hydration when the repository postinstall loaded TypeScript from an external pnpm modules directory.

Why This Change Was Made

The package dist scanner now resolves TypeScript through Node's CommonJS resolver, matching the existing NODE_PATH contract used by the Crabbox hydrate workflow. The AMI boundary stays unchanged: machine tooling remains prebaked while lockfile-specific dependencies hydrate per checkout.

User Impact

Maintainer AWS fallback runs can complete dependency hydration instead of reinstalling and deterministically failing with ERR_MODULE_NOT_FOUND.

Evidence

  • Before: an isolated reproduction using current main and TypeScript available only through NODE_PATH exits 1 with ERR_MODULE_NOT_FOUND.
  • After: the same isolated postinstall reproduction exits 0.
  • Testbox: tbx_01kz3e6wwxng3efmkp78teh9cg, Actions run 30800266875; 2 files and 50 tests passed.
  • Direct AWS proof on fix commit 41909b4f3fc730171066b9bde9b988beb4431d28:
    • One-off c7a.4xlarge lease cbx_b1dd661b1ee2 acquired and reached SSH readiness in 1m31.795s.
    • Local Actions hydration replayed .github/workflows/crabbox-hydrate.yml for the branch, synced 30,527 files / 373.5 MiB, completed pnpm install plus postinstall, and succeeded in 4m1.142s (run_id=local-cbx_b1dd661b1ee2).
    • Same-lease no-sync probe require("typescript") printed typescript=6.0.3; run run_d599340074c5 succeeded in 16.201s.
    • Lease cbx_b1dd661b1ee2 was stopped and verified released; active AWS lease list was empty.
    • An earlier interrupted allocation, cbx_a00bf32582ab, was also stopped and verified released.
  • Live origin/main was merged afterward with signed merge commit adf5362e959f0b6a4340a8f1d9d1397905953352; those three upstream commits do not touch the resolver, hydration workflow, setup action, or regression test.
  • Fresh autoreview on exact head adf5362e959f0b6a4340a8f1d9d1397905953352: clean, no accepted/actionable findings, patch correct at 0.99 confidence.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Aug 3, 2026
@vincentkoc vincentkoc self-assigned this Aug 3, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added 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. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The branch makes the package-dist scanner load TypeScript through Node’s CommonJS resolver so postinstall can find dependencies exposed through NODE_PATH, and adds a regression test for that external modules-directory layout.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for maintainer merge review. The focused resolver change matches the Crabbox hydration workflow’s external modules-directory contract, has targeted regression coverage, and the supplied direct AWS hydration replay provides real after-fix evidence; the remaining gate is the protected maintainer-owned merge decision on the current three-way result.

Priority: P2
Reviewed head: adf5362e959f0b6a4340a8f1d9d1397905953352
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, source-aligned repair with regression coverage and unusually strong direct-environment proof; final landing remains a protected maintainer decision.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The contributor supplied an after-fix direct AWS hydration replay with postinstall completion and an in-lease TypeScript resolution probe, supplemented by a targeted isolated regression test; private lease details should remain redacted in any further evidence.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The contributor supplied an after-fix direct AWS hydration replay with postinstall completion and an in-lease TypeScript resolution probe, supplemented by a targeted isolated regression test; private lease details should remain redacted in any further evidence.
Evidence reviewed 6 items Hydration contract: The workflow configures pnpm to use /var/tmp/openclaw-pnpm/node_modules and passes that directory as the pnpm modules directory during install; the postinstall path therefore needs to resolve dependencies outside a normal checkout-local node_modules.
Current failure boundary: Current main imports TypeScript as an ESM bare import in the package-dist scanner, while the scanner is imported by the postinstall script; this is the precise dependency-resolution boundary changed by the PR.
Patch and regression coverage: Commit 41909b4f3fc730171066b9bde9b988beb4431d28 replaces the ESM TypeScript import with createRequire(import.meta.url) and adds an isolated postinstall test whose only TypeScript location is supplied through NODE_PATH.
Findings None None.
Security None None.

How this fits together

Crabbox hydration installs OpenClaw dependencies into a configured pnpm modules directory before the repository postinstall runs. The package-dist scanner is invoked by that postinstall and must load TypeScript successfully so remote validation environments can finish setup.

flowchart LR
  A[Crabbox hydration job] --> B[pnpm external modules directory]
  B --> C[NODE_PATH exposes dependencies]
  C --> D[OpenClaw postinstall]
  D --> E[Package dist scanner]
  E --> F[CommonJS TypeScript resolution]
  F --> G[Hydration completes]
  E --> H[Bundled plugin package checks]
Loading

Decision needed

Question Recommendation
Should a maintainer accept this protected CI reliability repair once the current merged result has completed its required checks? Merge after current-head gates: Accept the focused resolver repair after the merge queue validates the current three-way result and required checks complete.

Why: The author is a repository member and the PR carries the protected maintainer label, so this workflow must leave final merge acceptance to a human even though the implementation and supplied real-environment proof are strong.

Before merge

  • Resolve merge risk (P1) - GitHub reports the branch as behind current main and several current-head checks are still running, so the merge queue must validate the exact three-way result before landing.
  • Resolve merge risk (P1) - This postinstall dependency-resolution path affects remote validation availability; retain the focused NODE_PATH regression coverage rather than treating the direct AWS replay as the only protection.
Agent review details

Security

None.

PR surface

Tests +44, Other +2. Total +46 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 44 0 +44
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 3 1 +2
Total 2 47 1 +46

Review metrics

Metric Value Why it matters
Production versus test delta production +3/-1, tests +44 The small production change is justified by the dependency-resolution boundary, while the larger test addition isolates the external NODE_PATH install layout.

Stored data model

Persistent data-model change detected: serialized state: test/scripts/postinstall-bundled-plugins.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Validate the queued merge result (recommended)
    Let the merge queue or a rebase run the required checks against the exact current-main merge before accepting this postinstall availability repair.
  2. Accept the provider-specific proof
    A maintainer may accept the supplied direct AWS replay and targeted regression test as sufficient evidence once ordinary required checks are green.

Technical review

Best possible solution:

Keep the CommonJS resolver at the package-dist scanner boundary, retain the isolated external-modules regression test, and merge only after the exact merged head passes the normal required checks.

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

Yes, at source level: current main’s package-dist scanner uses an ESM bare TypeScript import, while the hydration workflow places dependencies in an external pnpm modules directory. The PR’s targeted test constructs that NODE_PATH-only layout, and the supplied direct AWS replay reports the same postinstall path succeeding after the change.

Is this the best way to solve the issue?

Yes. Resolving TypeScript through createRequire(import.meta.url) changes only the scanner’s dependency-loading boundary and aligns it with Node’s CommonJS NODE_PATH contract used by the hydration workflow; it avoids altering the AMI or pnpm hydration design.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The contributor supplied an after-fix direct AWS hydration replay with postinstall completion and an in-lease TypeScript resolution probe, supplemented by a targeted isolated regression test; private lease details should remain redacted in any further evidence.
  • 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 is a bounded remote-validation reliability fix with limited blast radius outside maintainer CI and fallback infrastructure.
  • merge-risk: 🚨 availability: The changed postinstall scanner determines whether hydrated remote validation environments can complete dependency setup.
  • 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 (logs): The contributor supplied an after-fix direct AWS hydration replay with postinstall completion and an in-lease TypeScript resolution probe, supplemented by a targeted isolated regression test; private lease details should remain redacted in any further evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The contributor supplied an after-fix direct AWS hydration replay with postinstall completion and an in-lease TypeScript resolution probe, supplemented by a targeted isolated regression test; private lease details should remain redacted in any further evidence.

Evidence

What I checked:

  • Hydration contract: The workflow configures pnpm to use /var/tmp/openclaw-pnpm/node_modules and passes that directory as the pnpm modules directory during install; the postinstall path therefore needs to resolve dependencies outside a normal checkout-local node_modules. (.github/workflows/crabbox-hydrate.yml:35, 3f3e59b54d1c)
  • Current failure boundary: Current main imports TypeScript as an ESM bare import in the package-dist scanner, while the scanner is imported by the postinstall script; this is the precise dependency-resolution boundary changed by the PR. (scripts/lib/package-dist-imports.mjs:3, 3f3e59b54d1c)
  • Patch and regression coverage: Commit 41909b4f3fc730171066b9bde9b988beb4431d28 replaces the ESM TypeScript import with createRequire(import.meta.url) and adds an isolated postinstall test whose only TypeScript location is supplied through NODE_PATH. (scripts/lib/package-dist-imports.mjs:1, 41909b4f3fc7)
  • Post-merge-base check: No relevant hydration workflow, scanner, postinstall, or regression-test path changed on current main after the PR merge base, so the branch’s resolver repair is not superseded by the later main commits. (scripts/lib/package-dist-imports.mjs:3, 3f3e59b54d1c)
  • Real AWS behavior proof: The PR body and follow-up comment report a direct AWS c7a.4xlarge hydration replay on the repair commit: pnpm install plus postinstall completed, an in-lease require("typescript") probe returned 6.0.3, and the lease cleanup was verified. The supplied check context also marks the real-behavior-proof run successful. (41909b4f3fc7)
  • Feature provenance: Current-main blame attributes the package-dist scanner and its adjacent postinstall test setup to Peter Steinberger’s recent plugin-discovery work, identifying the current source-history owner for this execution path. (scripts/lib/package-dist-imports.mjs:1, 7c35cbc4f464)

Likely related people:

  • Peter Steinberger: Blame attributes the current package-dist scanner and surrounding bundled-postinstall test structure to this recent commit, making him the strongest source-history routing candidate for the scanner contract. (role: current source-path introducer; confidence: high; commits: 7c35cbc4f464; files: scripts/lib/package-dist-imports.mjs, test/scripts/postinstall-bundled-plugins.test.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-03T09:20:12.717Z sha 41909b4 :: needs maintainer review before merge. :: none

* origin/main:
  refactor(tts): absorb speech core package (#118513)
  fix(qa): restore Telegram release validation (#118542)
  fix(discord): report pending message search indexes (#118573)
@vincentkoc
vincentkoc marked this pull request as ready for review August 3, 2026 10:15
@vincentkoc

Copy link
Copy Markdown
Member Author

Direct AWS proof is complete.

  • Fix SHA tested: 41909b4f3fc730171066b9bde9b988beb4431d28
  • Provider/type: direct AWS, one-off c7a.4xlarge
  • Lease: cbx_b1dd661b1ee2
  • Acquire + SSH ready: 1m31.795s
  • Local Actions hydrate: 4m1.142s, including 30,527 files / 373.5 MiB sync, pnpm install, and postinstall
  • Same-lease probe: require("typescript") returned 6.0.3; run run_d599340074c5, 16.201s
  • Cleanup: test lease and earlier interrupted lease cbx_a00bf32582ab both verified released; active AWS list empty

The branch then merged three unrelated live main commits with signed merge commit adf5362e959f0b6a4340a8f1d9d1397905953352. None touch the resolver or hydration surfaces. Fresh autoreview on that exact head is clean with no accepted/actionable findings.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 3, 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 proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 3, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready evidence for exact head adf5362e959f0b6a4340a8f1d9d1397905953352:

Owner decision: accept this exact head for maintainer merge. Since the signed merge commit was pushed, origin/main advanced by 12 commits to 9c22a4349d8034ac38b60e5e7c21409bdd04c18f. I audited that drift: none of those commits touch scripts/lib/package-dist-imports.mjs, test/scripts/postinstall-bundled-plugins.test.ts, .github/workflows/crabbox-hydrate.yml, or .github/actions/setup-node-env/action.yml. Do not churn this branch again solely to follow moving main; preserve the signed series with a merge commit rather than squash.

No merge performed in this work lane.

@vincentkoc
vincentkoc merged commit db7c484 into main Aug 3, 2026
156 of 158 checks passed
@vincentkoc
vincentkoc deleted the fix/aws-hydrate-typescript-resolution branch August 3, 2026 10:28
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
…script-resolution

fix(ci): restore direct AWS dependency hydration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. 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. scripts Repository scripts 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