Skip to content

fix(tools): find turso in ~/.turso instead of reporting it missing - #135

Merged
ralyodio merged 1 commit into
mainfrom
worktree-turso-path-fix
Jul 31, 2026
Merged

fix(tools): find turso in ~/.turso instead of reporting it missing#135
ralyodio merged 1 commit into
mainfrom
worktree-turso-path-fix

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

/install turso succeeded, then /tools listed turso as not installed and /turso died with turso isn't on PATH.

The official turso installer unpacks to $HOME/.turso and only appends that dir to your shell profile — so the binary is on PATH for the next shell. moshcode resolves every tool against PATH alone, so the session that just installed it (and every already-running one) can't see it.

Fix

Tool specs can now declare binDirs — extra directories searched after PATH when resolving the executable:

  • executableCandidates / resolveExecutable / isInstalled / spawnSpec take optional extra dirs
  • openPassthrough reads target.binDirs, so the launch path is fixed too, not just the status dot
  • toolStatus() passes tool.binDirs through
  • turso declares binDirs: [~/.turso]

Searching after PATH means a real turso on PATH still wins; the fallback only kicks in when PATH misses.

Verification

  • Full suite: 467 tests, 0 failures (111 skipped, same as before)
  • New tests: fallback dir is found, absent/empty extra dirs are inert, and PATH wins over the install dir when both have a copy
  • End-to-end with a stub ~/.turso/turso under a fake $HOME: installed: true, /turso launch ok: true, code: 0

🤖 Generated with Claude Code

The official turso installer unpacks to $HOME/.turso and only appends
that dir to your shell profile, so the binary is on PATH for the NEXT
shell. moshcode resolves tools against PATH alone, so right after
`/install turso` the pit still showed turso as "not installed" and
`/turso` failed with "turso isn't on PATH" — in the session that
installed it, and in every already-running one.

Tool specs can now declare `binDirs`: extra directories searched after
PATH when resolving the executable. turso points at ~/.turso, so both
the status list and the passthrough launch find the binary the vendor
script just dropped. PATH still wins when a real turso is on it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio marked this pull request as ready for review July 31, 2026 07:38
@ralyodio
ralyodio merged commit a4cf5c5 into main Jul 31, 2026
3 checks passed
@ralyodio ralyodio mentioned this pull request Jul 31, 2026
ralyodio added a commit that referenced this pull request Jul 31, 2026
Cuts a release off main so the fixes merged after v0.13.1 actually reach
installs. v0.13.1 shipped before #135, so re-running the installer still
handed you a moshcode that reported turso as missing.

Included since v0.13.1:
- #135 fix(tools): find turso in ~/.turso instead of reporting it missing
- #134 fix(tui): stop styling the agent-view notice as an error
- #133 fix(runtime): deliver fire-and-forget notify() when the script throws

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@ralyodio
ralyodio deleted the worktree-turso-path-fix branch August 8, 2026 17:06
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.

1 participant