Skip to content

Fix Node 22 desktop dev startup - #2245

Merged
ymichael merged 1 commit into
get-bb:mainfrom
Roystbeef:fix/desktop-dev-node22
Aug 25, 2026
Merged

Fix Node 22 desktop dev startup#2245
ymichael merged 1 commit into
get-bb:mainfrom
Roystbeef:fix/desktop-dev-node22

Conversation

@Roystbeef

@Roystbeef Roystbeef commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What was wrong

The supported Node 22 desktop development path loaded apps/host-daemon/src/command-dispatch.ts directly through TSX, but several host-daemon contracts were imported as runtime values even though they are TypeScript types. Those erased exports do not exist at runtime, so the source dev server session stalled before the Electron shell could launch.

What changed

  • Mark the affected host-daemon command contracts as type-only imports.
  • No host-daemon wire contract changed, so HOST_DAEMON_PROTOCOL_VERSION is unchanged.

How you verified

  • pnpm exec turbo run typecheck --filter=@bb/host-daemon
  • Ran pnpm dev:desktop with Node 22.22.1 and verified that the dev server and Electron desktop sessions both started successfully.

No linked issue.

AGENT GENERATED: by GPT-5.6

@Roystbeef
Roystbeef marked this pull request as ready for review August 21, 2026 19:25
@ymichael
ymichael merged commit 42d2c1b into get-bb:main Aug 25, 2026
12 checks passed
@Roystbeef
Roystbeef deleted the fix/desktop-dev-node22 branch August 25, 2026 13:35
ymichael added a commit that referenced this pull request Aug 25, 2026
## What was wrong

The tarball smoke installed the packed package once for SDK checks, but
then launched every packaged CLI, server, and daemon through a fresh
`npx --package <tarball>` wrapper. That put npm package resolution and
subprocess startup inside each managed process's 60-second
HTTP-readiness budget. Under scheduler contention the wrapper could
consume nearly the entire budget before `bb-app` started its server
child, producing the observed live-child signature from [main push run
32810192666](https://github.com/get-bb/bb/actions/runs/32810192666/job/97687946973):
only the bb banner and `Starting server`, then the outer health timeout.
A scaled packed-startup harness reproduced that exact output three
times: under the same 60-burner load, the wrapped path emitted `Starting
server` at 9.582s of a 10s ceiling and timed out, while the
already-installed tarball emitted it at 112ms and reached health at
1.808s. The triggering PR #2245 changed only type imports and had no
runtime effect. The package-smoke job runs one Turbo task on its own
runner, so there is no evidence of within-job package-shard
oversubscription; transient runner contention is the reproduction
condition, not the root cause.

## What changed

Keep one real `npx --package <tarball> -- bb-app --help` invocation to
verify the package's advertised npx resolution, installation, and
bin-dispatch path. Separately install the packed tarball once with
lifecycle scripts enabled, then execute its npm-created `.bin` entries
directly for help/config, full-stack, CLI/plugin, standalone server, and
daemon-join checks. This removes repeated npm startup from readiness
budgets while preserving the real packed-install boundary and every
existing assertion: server and daemon health, builtin plugins, SDK
import/status, provider bridges, plugin host worker, installed-package
repacking, and multi-daemon join behavior.

No timeout or retry budget changed. No server/daemon wire contract,
public CLI behavior, documentation, or `HOST_DAEMON_PROTOCOL_VERSION`
change is involved.

## How you verified

- Red before the fix: the scaled packed-startup harness under 60 CPU
burners produced the exact `bb` / `Starting server` timeout three times
for `npx --package <tarball> bb-app`; direct execution of the same
installed tarball passed each reversed-order run in 1.724–1.856s.
- Green after the fix: the exact final full smoke, including the
retained real npx entrypoint, passed under the same 60-burner contention
in 192.78s. Its unchanged plugins, host worker, bridges, full-stack, and
daemon-join assertions all passed.
- Normal local smoke improved from 51.02s before to 34.44s after without
changing any clock.
- `pnpm exec turbo run build typecheck test --filter=bb-app --force` —
14/14 tasks passed; bb-app 72/72 tests passed.
- `pnpm exec turbo run smoke:tarball --filter=bb-app --force
--cache-dir=.turbo/cache --output-logs=new-only` — 12/12 tasks passed;
real tarball smoke passed after restoring the npx boundary.
- `pnpm exec prettier --check packages/bb-app/scripts/smoke-tarball.mjs`
and `git diff --check` passed.

> AGENT GENERATED: by GPT-5.6-Sol
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.

2 participants