Skip to content

Windows: BUN_CHILD_FLAGS --config=NUL panics Bun 1.3.10 — terminal-agent crash window every few seconds #3085

Closed

Description

@adammartin0087

Summary

On Windows, every terminal-agent spawn crashes Bun in ~3ms with:

panic(main thread): start index 1 is larger than end index 0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

The trigger is BUN_CHILD_FLAGS in browse/src/terminal-agent-control.ts:146, which passes --config=NUL on win32 (added in v1.91.19.0, #3025). Bun 1.3.10 on Windows panics while parsing that flag, before the script runs.

The crash opens a visible console window. The supervisor and watchdog then respawn the agent (1s/2s/4s/8s backoff, then every 30–60s), so the user gets a Bun crash window every few seconds for as long as a headed browse connect daemon is alive. This applies to any daemon on the machine, including one started by another session in a different repo.

Repro (no gstack needed)

echo 'console.log("ok")' > probe.ts
bun run --no-env-file --config=NUL probe.ts   # panic(main thread): start index 1 is larger than end index 0
bun run --no-env-file probe.ts                 # ok

Environment

  • gstack v1.91.59.0
  • Bun 1.3.10 (30e609e0), Windows 11 x64 (win11_dt)
  • Daemon on the Node lane (server-node.mjs)

Suggested fix

Related

Activity

  1. adammartin0087 commented on Oct 8, 2026

    @adammartin0087
    Author

    Update: upgrading Bun fixes it. On Bun 1.4.2 (bun upgrade from 1.3.10, same Windows 11 box), the repro above runs cleanly: bun run --no-env-file --config=NUL probe.ts prints ok. After the upgrade the running daemon's next terminal-agent respawn succeeds and the crash windows stop.

    So the panic is a Bun bug fixed somewhere in 1.3.11–1.4.2. That points to a smaller fix on the gstack side: require a minimum Bun version (or check it before spawning and print a clear "upgrade Bun" message) instead of dropping --config=NUL. Windows users still on 1.3.10 will keep hitting this until they upgrade.

  2. capy-ai commented on Oct 11, 2026

    @capy-ai
    Contributor

    Fixed in v1.91.86.0 (47cd4a9, #3135). Bun children now get an empty private bunfig instead of --config=NUL, which avoids the Bun 1.3.10 panic on Windows. Thanks @adammartin0087 for the clear repro. Update with /gstack-upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions