Skip to content

fix: resolve bundled text assets relative to the require module - #14

Merged
Haleclipse merged 1 commit into
CometixSpace:masterfrom
cracer4869:fix/resolve-text-assets-from-module
Sep 10, 2026
Merged

Haleclipse merged 1 commit into
CometixSpace:masterfrom
cracer4869:fix/resolve-text-assets-from-module

Conversation

@cracer4869

@cracer4869 cracer4869 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Starting @cometix/claude-code@2.1.261 from a project directory fails with ENOENT for loopAutonomousPreamble-5hfhrxrk.md, even though the file exists in the installed package. The runtime-path rewrite now emits relative paths, but the .md/.txt branch passes them directly to readFileSync, which resolves against process.cwd().

Resolve text paths through the module-scoped require.resolve() before reading them, matching the resolver used for other require targets.

  • Add regression fixtures for both BunFS path forms, flat and nested module layouts, and paths containing spaces, #, and Unicode. Check execution from inside and outside the package, same-named files in the working directory, absolute text paths, and ordinary JSON loading.
  • Run the tests on Node 24 on Windows and Ubuntu.
  • Run release smoke checks outside the package directory so the original cwd-dependent behavior cannot pass unnoticed. Capture help output before printing its first lines.

Validation:

  • GitHub Actions: Node 24 regression tests pass on both Windows and Ubuntu.

  • All four regression tests fail with ENOENT before the fix and pass afterward on Windows / Node 24.18.0.

  • An isolated copy of the installed 2.1.261 package reproduces the error with node <package>/cli.js --help from an external directory. Replacing only its generated require shim makes the same command exit 0. The global installation was left unchanged.

  • node --check scripts/esm-chunk-patch.mjs, node --check test/esm-text-assets.test.mjs, workflow YAML parsing, release verification shell syntax, and git diff --check pass.

The full cross-platform release build was not run locally.

@cracer4869

Copy link
Copy Markdown
Contributor Author

我又来啦!!!彗星佬

@Haleclipse
Haleclipse merged commit 3bf95d4 into CometixSpace:master Sep 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants