Conversation
When jtag is invoked via the install.sh-created symlink at /home/joel/.local/bin/jtag, BASH_SOURCE[0] is the symlink path. dirname on that gives /home/joel/.local/bin, so neither dist/cli-bundle.js nor cli.ts can be found there. Silent miss → tsx fallback fires → ERR_MODULE_NOT_FOUND → chat probe fails. Use readlink -f to walk the symlink chain to the real src/jtag, so SCRIPT_DIR resolves to the actual src/ directory regardless of how the user invoked the script. Bundle check + tsx fallback both work whether jtag was run directly (./jtag) or via the symlinked PATH entry (jtag). Caught locally by carl-install-smoke on Windows/bigmama-1 today (continuum-b69f, 2026-05-03). Earlier fix #93 (36e85d2) only covered the direct-./jtag case from Phase 4 chat-probe — left the much more common symlinked-PATH case still broken. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the chat-probe failure on Carl-Windows install path uncovered by carl-install-smoke run on Windows/bigmama-1 today.
src/jtag derived SCRIPT_DIR from BASH_SOURCE without resolving symlinks. install.sh 's mod_jtag_bin_link symlinks ~/.local/bin/jtag → src/jtag, so when Carl runs jtag command from PATH, BASH_SOURCE[0] is the symlink path. dirname gives ~/.local/bin — not the directory holding cli-bundle.js or cli.ts.
Result: bundle check silently misses, tsx fallback fires npx tsx ~/.local/bin/cli.ts → ERR_MODULE_NOT_FOUND → chat probe fails with exit 1, the entire chat-probe phase of the install fails.
Fix
readlink -f walks the symlink chain to the real src/jtag, so SCRIPT_DIR resolves to the actual src/ directory regardless of how the user invoked the script. Bundle check and tsx fallback now both work whether jtag was run directly (./jtag from a checkout) or via the symlinked PATH entry (jtag from anywhere).
Why #93 (36e85d2) didn't cover this
#93 changed the tsx fallback from npx tsx cli.ts (cwd-relative) to npx tsx $SCRIPT_DIR/cli.ts (absolute via SCRIPT_DIR). That fixed the direct-./jtag case but left SCRIPT_DIR derivation symlink-unaware, so the much more common symlinked-from-PATH case still resolved to the wrong dir.
Test plan
🤖 Generated with Claude Code