8000 Warn when the resolved claude is a Windows binary under /mnt/ (#31) by simon-inkie · Pull Request #60 · simon-inkie/inkie-deck · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .specs/31-warn-windows-claude/SPEC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 31 Warn when the resolved claude is a Windows binary under /mnt/

## TL;DR
On WSL, `claude` can resolve to a Windows executable. Add one shared check that warns, naming the path and the fix.

## Scope
- `packages/base/bin/claude-binary-check.sh`: `claude_binary_is_foreign`, `warn_if_foreign_claude`.
- Called once per run from `boot-agents.sh` and `workspace.sh` (before the launch loop) and `create-agent.sh` (before the verify probe).
- INSTALL.md note under Known limitations.

## Acceptance
- A path under `/mnt/` or ending `.exe`/`.cmd` prints a warning with the path, the problem and the fix.
- A normal path prints nothing.
- Launch is not blocked.

## Test plan
`packages/base/test/claude-binary-check.test.sh`, registered in `shell-suites.test.ts`: fake `/mnt/c` path, `.exe`/`.cmd`, normal paths, absent claude.

## Decisions log
- Warn only, not stop: a Windows claude can still run through WSL interop, and the path alone does not prove breakage. Stopping would lock out working setups.
- Case-insensitive on `.exe`/`.cmd` is limited to upper and lower forms; mixed case is not worth a `shopt`.

## Follow-ups
None.

## Review feedback
Opus round 1 (approve, no blockers):
1. Warning printed once per agent. Fixed: called once before the loop in boot-agents.sh and workspace.sh.
2. INSTALL.md note sat above the section's opening line. Fixed: moved alongside the other bold entries.
3. Check runs in the script's shell, not the tmux pane's. Documented as best-effort in the lib header.
Nits, not changed: symlinks are not resolved (noted in the lib header); any Linux path under /mnt/ warns (accepted); mixed-case .Exe missed (deliberate).
7 changes: 7 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,13 @@ Current, verified, and written down rather than discovered later.
**No authentication.** Repeated here because it belongs on any list of this
kind. See the top of this document.

**On WSL, `claude` can resolve to a Windows binary.** PATH often includes
Windows directories, so `command -v claude` may return a path under `/mnt/c/`
or ending in `.exe` or `.cmd`. The boot, workspace and create-agent scripts
print a warning naming that path and carry on; they do not stop, because a
Windows binary can still work through WSL interop. If agents fail to start,
install the Linux build inside WSL or put its directory earlier in `PATH`.

**A complete, valid header quoted inside a message body splits that message
in two.** Fixed on 2026-08-14, and this is what is left of it. Both readers,
the python3 CLI and the web application, used to take a block boundary off
Expand Down
3 changes: 3 additions & 0 deletions packages/base/bin/boot-agents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ fi

# Pinned claude session ids, shared with workspace.sh.
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/claude-session.sh"
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/claude-binary-check.sh"

# Per-agent runtime (claude default; override via $AGENTS_HOME/<name>/.runtime).
get_runtime() {
Expand Down Expand Up @@ -781,6 +782,8 @@ ALREADY_UP=0
WAITING=0
FAILED=0
ARMED=0
# Once for the whole boot, not per agent. Best-effort: see claude-binary-check.sh.
warn_if_foreign_claude
for a in "${AGENTS[@]}"; do
if outcome=$(launch_agent "$a"); then
readiness_check=wait_for_readiness
Expand Down