Skip to content

Run the Pi extension's server on Node under a Bun-compiled Pi - #8

Merged
coffeecoproject merged 1 commit into
mainfrom
fix/pi-bun-runtime
Nov 9, 2026
Merged

coffeecoproject merged 1 commit into
mainfrom
fix/pi-bun-runtime

Conversation

@coffeecoproject

Copy link
Copy Markdown
Owner

Summary

In a Bun-compiled Pi (the release binary, Pi-Bolt), process.execPath is Pi itself, so the extension started another Pi instead of LayerMap's server, and the session hung waiting for an answer.

  • Under Bun, the server runs on the Node on PATH, resolved to a full path with findExecutable. If there is none, the session reports it and carries on.
  • A server that does not answer initialize within 30 seconds is stopped and reported. The timeout ends once initialize is answered, so opening a map cannot get a healthy server killed.
  • Pi on Node still uses process.execPath.

Fixes #7

Testing

  • test/pi.test.ts: 11 tests pass. tsc passes, and biome passes on the changed source files.
  • New tests cover a simulated Bun host, no Node on PATH, a Node host with an empty PATH, a server that never answers, and a server that answers initialize but is slow afterwards. Each fails when the matching behaviour is removed.
  • Not run on a real Bun-compiled Pi, and not yet on Windows. The full test suite was not run locally.

🤖 Generated with Claude Code

In a Bun-compiled program process.execPath is that program, so the
extension started another Pi instead of LayerMap's server and the session
waited for an answer that never came. Under Bun the server now runs on the
Node on PATH, by its full path, and a server that does not answer
initialize within 30 seconds is stopped and reported.

Fixes #7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coffeecoproject
coffeecoproject merged commit b7dc72f into main Nov 9, 2026
3 checks passed
@coffeecoproject
coffeecoproject deleted the fix/pi-bun-runtime branch November 10, 2026 06:37
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.

Pi extension hangs on Bun-compiled Pi hosts: MapServer spawns process.execPath, which is the Pi binary

1 participant