[BUG] FleetView dispatched agents doesn't properly use the correct version when dispatching an agent with an up to date version while an existing previous version is running on the background
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When dispatching an agents with the new agents view with an up to date claude code in a terminal while a process using a previous version is still active, the claude code session with latest version is unable to dispatch an agent without an ENOENT error
What Should Happen?
Claude agents view should dispatch agents without errors
Error Messages/Logs
[worker crashed (ENOENT: no such file or directory, posix_spawn '/opt/homebrew/Caskroom/claude-code@latest/2.1.139/claude') — respawning…]
Steps to Reproduce
- Install Claude Code via Homebrew cask, launch a session.
- While the session is running, let the cask auto-upgrade (or run brew upgrade --cask claude-code@latest).
- Dispatch any agent / FleetView worker — posix_spawn ENOENTs on the old versioned path even though /opt/homebrew/bin/claude already points to the new version.
- Quitting the UI doesn't fix it if any host process survives (e.g. --continue reattaches to the same poisoned host).
Likely root cause on their side: the parent caches process.execPath at startup and reuses it to spawn workers. Fix is to either re-resolve /opt/homebrew/bin/claude (or the PATH-found claude) at spawn time, or detect ENOENT on spawn and retry through PATH.
Similar bug #18019 and #25364
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.139
Claude Code Version
2.1.140
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗