Skip to content

Build: harden A2UI bundle for Windows+WSL shell path(AI-assisted:Codex)#31840

Open
ly85206559 wants to merge 12 commits intoopenclaw:mainfrom
ly85206559:fix/windows-a2ui-bundle-wsl-path
Open

Build: harden A2UI bundle for Windows+WSL shell path(AI-assisted:Codex)#31840
ly85206559 wants to merge 12 commits intoopenclaw:mainfrom
ly85206559:fix/windows-a2ui-bundle-wsl-path

Conversation

@ly85206559
Copy link
Copy Markdown

@ly85206559 ly85206559 commented Mar 2, 2026

Summary

  • add a Node-based A2UI bundling entry at scripts/bundle-a2ui.mjs
  • keep scripts/bundle-a2ui.sh as a thin launcher, with Windows+WSL handling for node.exe
  • make bundling command execution resilient to Windows/WSL path and executable resolution differences

Why

pnpm build could fail on Windows when canvas:a2ui:bundle was executed through bash, because the mixed WSL shell + Windows Node environment could not reliably resolve downstream commands.

Validation

  • pnpm canvas:a2ui:bundle
  • pnpm build

AI-assisted

  • AI-assisted: Codex
  • Testing: locally ran pnpm canvas:a2ui:bundle + pnpm build; CI covers pnpm check + pnpm test (including Windows shards).
  • Understanding: scripts/bundle-a2ui.sh is a launcher for mixed WSL bash + Windows node.exe. scripts/bundle-a2ui.mjs performs hash-based incremental bundling, runs tsc, and invokes rolldown with robust Windows/WSL executable fallback logic (including .cmd shims and UNC/WSL path edge cases).

Key Review Fixes

  • Continue fallback candidates when a .cmd probe exits non-zero under shell: true (don’t fail-fast; try later candidates).
  • Keep probing rolldown candidates after a failed --version probe before falling back to pnpm dlx.
  • Avoid running .cmd tools with a UNC working directory (e.g. \\wsl.localhost\...) to prevent cmd.exe cwd failures.

@openclaw-barnacle openclaw-barnacle bot added scripts Repository scripts size: M labels Mar 2, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1b198ed5d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 2, 2026

Greptile Summary

Refactored A2UI bundling to improve Windows/WSL compatibility by moving core logic from bash to Node.js. The new bundle-a2ui.mjs handles platform-specific executable resolution (.cmd extensions, multiple fallback paths for pnpm/rolldown), while bundle-a2ui.sh becomes a thin launcher that detects and invokes Node/Node.exe appropriately.

Key improvements:

  • Consolidated hash computation, TypeScript compilation, and rolldown bundling into a single Node.js script
  • Added robust Windows executable resolution with fallback strategies
  • Implemented proper WSL path conversion when invoking Windows Node from WSL bash
  • Preserved incremental build optimization via hash comparison

The implementation correctly handles the complex Windows/WSL environment where bash shell and Windows Node need to coordinate, addressing the original issue where mixed environments couldn't reliably resolve downstream commands.

Confidence Score: 4/5

  • This PR is safe to merge with low risk - it's a well-structured refactoring of build tooling that improves cross-platform compatibility
  • The refactoring is well-executed with proper error handling, no security vulnerabilities (uses safe spawnSync with args arrays), and addresses a real Windows/WSL compatibility issue. The code correctly handles complex cross-platform path resolution. Score is 4 rather than 5 due to the inherent complexity of Windows/WSL interop which requires careful validation across different environments.
  • No files require special attention - both changed files implement straightforward, well-structured logic

Last reviewed commit: b1b198e

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f565967323

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ly85206559 ly85206559 force-pushed the fix/windows-a2ui-bundle-wsl-path branch from ce0a1ab to 39e8753 Compare March 2, 2026 16:50
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39e8753254

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ly85206559 ly85206559 force-pushed the fix/windows-a2ui-bundle-wsl-path branch 3 times, most recently from 65f9be5 to 5cd790d Compare March 3, 2026 01:30
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5cd790d7ee

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ly85206559 ly85206559 changed the title Build: harden A2UI bundle for Windows+WSL shell path Build: harden A2UI bundle for Windows+WSL shell path(AI-assisted:Codex) Mar 3, 2026
@ly85206559
Copy link
Copy Markdown
Author

ly85206559 commented Mar 3, 2026

Windows shard stuck/hung, reran CI please,ths @steipete

@ly85206559 ly85206559 force-pushed the fix/windows-a2ui-bundle-wsl-path branch 5 times, most recently from 9bbc733 to fbfd6dc Compare March 3, 2026 03:46
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbfd6dc9fd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ly85206559 ly85206559 force-pushed the fix/windows-a2ui-bundle-wsl-path branch from 0b902fc to d066533 Compare March 3, 2026 06:02
@ly85206559
Copy link
Copy Markdown
Author

Hi team, this PR improves A2UI bundling on Windows/WSL (scripts, no product logic).
Could someone from JS Infra or Core take a look? @cpojer @joshavant — happy to address any feedback. Thanks!

@ly85206559
Copy link
Copy Markdown
Author

Quick status update: this PR is up to date with main, CI is passing, and all review comments have been addressed.

When a maintainer has bandwidth, could someone help with final review/merge? Thanks!

PR: #31840

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

Labels

scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant