fix(session-broker): detect Windows bunfs paths when auto-launching the daemon#507
Merged
Merged
Conversation
…he daemon Bun single-file executables on Windows report argv[1] as a virtual B:\~BUN\root\<name>.exe path. That misses the Unix /$bunfs/ check but matches the script-entrypoint pattern, so the daemon relaunched the binary with the virtual path as a bogus first argument and never came up, leaving 'hunk session' commands with no live sessions. Fixes #502 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
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.
Fixes #502.
What
On Windows, Bun-compiled single-file executables report
argv[1]as a virtual path on Bun'sB:drive (B:\~BUN\root\hunk.exe— the reporter's log shows the forward-slash form).resolveDaemonLaunchCommandonly recognized the Unix virtual prefix (/$bunfs/), so the Windows path fell through to the script-entrypoint branch (it contains path separators) and the auto-launched daemon becamehunk.exe B:/~BUN/root/hunk.exe daemon serve— the compiled binary received the virtual path as a bogus first argument, the daemon never started, andhunk session listfound no sessions unlesshunk daemon servewas started manually.How
Recognize the Windows bunfs prefix (
b:/~bun/, case-insensitive, either separator) alongside/$bunfs/in a smallisBunfsEntrypointhelper, so compiled binaries relaunch viaexecPathwith cleandaemon serveargs on every platform.Testing
bun run typecheck, fullbun test(1084 pass), format, lint.🤖 Generated with Claude Code