fix: pass CLAUDE_PROJECT_DIR so execute_file resolves relative paths#12
fix: pass CLAUDE_PROJECT_DIR so execute_file resolves relative paths#12dunika wants to merge 1 commit into
Conversation
…e paths correctly start.sh does `cd "$DIR"` (into the plugin install directory) before launching node, which means process.cwd() in the server becomes the plugin directory. Relative paths passed to execute_file then resolve against the wrong directory. Capture $(pwd) before the cd and pass it as CLAUDE_PROJECT_DIR env var to the node process so the server can resolve relative paths against the user's actual project directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for the contribution @dunika! 🙏 I've added unit tests and wired the server-side consumption of What was added:
Technical note: All 8 tests passing ✅ |
Captures the user's working directory in start.sh before cd-ing into the plugin directory, and passes it to PolyglotExecutor so executeFile resolves relative paths correctly. Contributor: dunika
|
Merged into This will be included in the next release. |
|
@dunika Sorry about closing this instead of merging — that was a mistake on my end. Your changes have been merged into the |
## What's Changed ### Bug Fixes - fix: stream-level byte cap to prevent OOM from runaway output (#5) — @rjkaes - fix: shell $-expansion vulnerability in executeFile paths (#7) — @rjkaes - fix: wire searchWithFallback, eliminate ephemeral DB, harden store (#4) — @rjkaes - fix: pass CLAUDE_PROJECT_DIR for relative path resolution (#12) — @dunika - fix: use npx tsx in skills instead of build/cli.js (#9) — @amoslives ### New Features - feat: add Elixir language support (#8) — @ekosz ### Chore - Dynamic contributor avatars via contrib.rocks - Simplified test:all with glob pattern - Version bump 0.7.3 → 0.8.0 ## New Contributors - @rjkaes - @ekosz - @dunika - @amoslives - @InTheCloudDan
|
Perfect - thanks! I really appreciate you making this open source. |
Summary
start.shdoescd "$DIR"into the plugin install directory before launching node, soprocess.cwd()in the server becomes the plugin directoryexecute_filethen resolve against the wrong directory$(pwd)before thecdand passes it asCLAUDE_PROJECT_DIRenv var to the node processChanges
CLAUDE_PROJECT_DIR(defaulting to$(pwd)) on line 2, before thecdexec nodeinvocations (bundle and fallback paths)Test plan
execute_filewith a relative path resolves against the project directory, not the plugin directoryFixed Error 1 — Silent misread
Fixed Error 2 — ENOENT