qwen-code/packages
LaZzyMan 9f4bd9be5e fix(core): probe vendor directory existence to resolve WASM path robustly
The previous fix used fs.realpathSync(fileURLToPath(import.meta.url)) to
resolve symlinks before computing the WASM path.  This works in the common
case (/usr/bin/qwen → /usr/lib/node_modules/.../cli.js), but silently falls
back to the unresolved symlink path when:

  - realpathSync throws (ENOENT, EACCES, ELOOP, or other OS-level errors)
  - Node.js has already resolved import.meta.url to the real path on some
    platforms (making realpathSync a no-op and the first candidate correct),
    but the vendor files are still not found at that location

The new approach for the bundle case (inSrcUtils = false) collects up to four
candidate directories:

  1. path.dirname(fileURLToPath(import.meta.url))  — already resolved on
     Node.js 18+ on most platforms
  2. path.dirname(realpathSync(import.meta.url))   — symlink-resolved fallback
  3. path.dirname(process.argv[1])                 — entry point as invoked
  4. path.dirname(realpathSync(process.argv[1]))   — resolved entry point

It then calls fs.existsSync on each candidate path for the requested .wasm
file and returns the first one that actually exists, rather than trusting
that a single path computation is correct.  If none exist we fall back to
the first candidate so the caller still gets a deterministic ENOENT (instead
of silently using a wrong path).

Fixes #2758
2026-03-31 15:00:37 +08:00
..
cli chore: bump version to v0.13.1 (#2716) 2026-03-27 18:32:26 +08:00
core fix(core): probe vendor directory existence to resolve WASM path robustly 2026-03-31 15:00:37 +08:00
hook_design/hooks_ui add test for hooks ui 2026-03-24 15:23:31 +08:00
sdk-java fix(core/rateLimit): add support for IdealTalk rate limit error code 1305 2026-02-28 11:05:41 +08:00
sdk-typescript docs(sdk): enhance coreTools/excludeTools/allowedTools documentation with permissions reference 2026-03-24 22:26:54 +08:00
test-utils chore: bump version to v0.13.1 (#2716) 2026-03-27 18:32:26 +08:00
vscode-ide-companion chore: bump version to v0.13.1 (#2716) 2026-03-27 18:32:26 +08:00
web-templates chore: bump version to v0.13.1 (#2716) 2026-03-27 18:32:26 +08:00
webui chore: bump version to v0.13.1 (#2716) 2026-03-27 18:32:26 +08:00
zed-extension chore(zed-extension): update package version to 0.10.0 2026-02-06 14:26:01 +08:00