Repository navigation
Start bb and run the bb CLI on native Windows - #4657
Merged
Merged
Conversation
Every built-in plugin failed manifest validation on Windows because the containment check compared resolved paths against `rootDir + "/"`, and the bundled `bb` CLI could not be spawned because it is an extensionless shebang script. - Check plugin manifest and code-theme containment with `isPathWithinDirectory`. - Run the extensionless bundled CLI through Node on Windows in the launcher and in the BB_CLI re-exec, and ship `bb.cmd` beside it so shells find `bb`. - Add `smoke:boot`, which starts the built bb-app, runs the bundled CLI, and waits for the built-in plugins, plus a Windows CI job that runs it. Co-Authored-By: Claude Code <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 1, 2026
SawyerHood
marked this pull request as draft
October 1, 2026 23:37
SawyerHood
marked this pull request as ready for review
October 2, 2026 01:41
SawyerHood
added a commit
that referenced
this pull request
Oct 2, 2026
## Human comments
## What was wrong
`TerminalManager.openTerminal` returned `unsupported_platform: Native
Windows terminals are not supported` for every open on Windows, so the
Terminals panel and `bb terminal create` did nothing there. Behind that
refusal the shell lookup only knew `$SHELL`, `/bin/zsh`, `/bin/bash`,
and `/bin/sh`, commands were always passed as `-lc`, and closing a
terminal called `pty.kill(signal)`, which node-pty rejects on Windows
("Signals not supported on windows"). Separately, `bb terminal send
--enter` appended a line feed; PowerShell's line editor treats that as
"continue on the next line", so the command was never submitted. Part of
#1206.
## What changed
- New `apps/host-daemon/src/terminals/terminal-shell.ts`: the Windows
shell is PowerShell 7 (`pwsh.exe`) when it is on PATH, otherwise Windows
PowerShell under `%SystemRoot%`, otherwise `%ComSpec%`. Start arguments
follow the shell: `-NoLogo -Command <text>` for PowerShell, `/d /s /c
<text>` for cmd, `-lc <text>` for POSIX shells (including Git bash). The
terminal title drops `.exe`.
- `terminal-manager.ts`: the Windows refusal and the now-unused
`platform` option are removed. On Windows the pty is closed with
`pty.kill()` and no signal; macOS and Linux still signal the process
group.
- `bb terminal send --enter` sends a carriage return, which is what a
terminal emulator sends for the Enter key. Cooked-mode POSIX shells
receive it as a newline through the tty's CR-to-NL translation, and
raw-mode line editors bind it to accept-line. The flag's help text now
reads "Press Enter after the text".
- A PowerShell terminal started with a command exits with that command's
exit code. `-Command` by itself reports 1 for every failure, so the
daemon appends a check that exits with `$LASTEXITCODE` when the last
native command failed and with 1 when a cmdlet failed.
- `bb terminal create -- <args>` sends the argument list unchanged in a
new `argv` start mode, and the daemon quotes it for the shell it
selected: single quotes after the call operator for PowerShell, double
quotes for cmd, single quotes for POSIX shells. Before, the CLI quoted
for a POSIX shell whatever the target machine ran.
- `bb guide terminals` and the bb-cli skill
(`plugins/bb-guide/skills/bb-cli/references/thread-operation.md`) say
which shell a terminal runs on each platform and that the argument-list
form is quoted for it.
Wire change: the terminal start field accepts `{ mode: "argv", argv }`
in `packages/host-daemon-contract` and `packages/server-contract`, and
`HOST_DAEMON_PROTOCOL_VERSION` goes from 224 to 225.
## How you verified
- Windows 11 Enterprise VM (build 26300), on a branch with this change
on top of #4657 (needed to build on Windows): `bb terminal create
--machine bb-win11 --cwd C:\src\plainrepo --command "git status; echo
done-marker"` exited 0 and printed the git status and `done-marker`; an
interactive terminal opened with title `powershell` and the prompt `PS
C:\src\plainrepo>`; `bb terminal send <id> --text hostname --enter`
printed `bb-win11` and returned to the prompt; `bb terminal close <id>`
took the session's PowerShell process count from 1 to 0.
- Before the `--enter` change the same send left PowerShell at its `>>`
continuation prompt with `hostname` unsubmitted.
- Exit codes and argument lists, same VM, on a branch combining all the
open Windows changes: `--command "cmd /c exit 7"` ended with exit code 7
and `--command 'node -e "process.exit(3)"'` with 3 (both were 1 before);
a failing cmdlet (`Get-Item <missing> -ErrorAction Stop`) ended with 1
and `Write-Output ok` with 0. `bb terminal create -- node -e <script>
"C:\bb-setup\argv out.json" "two words" "it's" "semi;colon"
'$env:USERNAME' "a&b" "C:\Program Files\x"` wrote exactly those six
arguments to the file, and `-- node -e "process.exit(9)"` ended with 9.
- Linux: `turbo run lint typecheck test` for `@bb/host-daemon`,
`@bb/cli`, `@bb/host-daemon-contract`, `@bb/server-contract`,
`@bb/templates`, and the bb-guide plugin passes, including the existing
real-pty terminal test. `terminal-shell.test.ts` covers shell
classification, start arguments and quoting per shell, the exit-code
suffix, titles, and the Windows shell order; the CLI tests pin the
carriage return and the `argv` start mode. `check-npm-version-guard.mjs`
passes without a plugin SDK bump.
Not verified: `--enter` against a full-screen terminal program on macOS
or Linux; cmd as the fallback shell on a machine without PowerShell,
including its argument quoting, which only the unit tests cover;
PowerShell 7 (the VM has only Windows PowerShell 5.1).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
> AGENT GENERATED
---------
Co-authored-by: Claude Code <[email protected]>
SawyerHood
added a commit
that referenced
this pull request
Oct 2, 2026
## Human comments
## What was wrong
On native Windows the installed provider CLIs were detected wrongly or
could not be started:
- `resolveExecutablePath` took the first line of `where codex`. npm
installs an extensionless `sh` shim beside `codex.cmd`, and `where`
lists the shim first, so bb reported an executable path Windows cannot
run.
- The Codex and Pi bridges launched their CLI with `node:child_process`
`spawn("codex" | "pi")`. Node's `spawn` only finds `.exe` and `.com` by
name, so an npm install (`codex.cmd`) failed and `provider models codex`
returned `missing_executable`.
- Claude Code's native installer puts `claude.exe` in
`%USERPROFILE%\.local\bin`, which is not on PATH. bb looked only on PATH
(and in `$HOME`, which is unset on Windows), so it reported Claude Code
as not installed and offered the `curl … | bash` installer.
Part of #1206.
## What changed
- `provider-maintenance-kit.ts`: `resolveExecutablePath` picks the first
`where` result whose extension is in `PATHEXT` (new pure
`selectResolvedExecutable`) and reports the CLI as missing when none has
one; macOS and Linux still take the first `which` result.
`downloadedInstallerCommand` takes an optional `{ powershellUrl }` and
returns `powershell.exe … "irm <url> | iex"` on Windows when one is
given.
- `@get-bb/plugin-sdk/provider-bridge` exports
`experimental_spawnPortableProcess` (the daemon's existing cross-spawn
launcher). The Codex app-server connection and the Pi RPC child use it
in place of `spawn`. Entries added to `docs/api_to_audit.md` and to the
Agent providers surface of the Plugin Guide
(`plugins/plugin-api-docs/src/surfaces.ts`); the plugin SDK version goes
to 0.6.13.
- The same subpath exports `experimental_killPortableProcess`. For an
npm-installed CLI the launcher's child is the `cmd.exe` that runs the
`.cmd` shim, and killing only that wrapper leaves the provider running.
On Windows the new function stops the child's whole process tree;
elsewhere it sends the signal as before. The Codex connection and the Pi
RPC child use it at every place they killed the child.
- Claude Code: the maintenance probes fall back to
`%USERPROFILE%\.local\bin\claude.exe` on Windows when `claude` is not on
PATH, the session resolver looks for `claude.exe` on PATH and at that
location, and the install action uses `https://claude.ai/install.ps1` on
Windows.
Behavior on macOS and Linux is unchanged. The Cursor installer action is
still the bash script on Windows; that needs Cursor's Windows install
command and is not part of this PR.
## How you verified
- Windows 11 Enterprise VM (build 26300) with `npm install -g
@openai/codex` (0.160.0) and Claude Code installed by its PowerShell
installer (2.1.287, not on PATH), on a branch with this change on top of
#4657 (needed to build on Windows):
- `bb machine provider-cli status`: Codex `executablePath` is
`…\npm\codex.cmd` (was `…\npm\codex`), Claude Code is `installed: true`
at `C:\Users\bb\.local\bin\claude.exe` version 2.1.287 (was `installed:
false`).
- `bb provider models codex` and `bb provider models claude-code` list
models (both returned `missing_executable` before).
- Linux: `turbo run lint typecheck test` for
`@bb/provider-bridge-protocol`, `@get-bb/plugin-sdk`, `@bb/domain`, and
the Claude Code, Codex, and Pi provider plugins passes (22 of 22 tasks).
`check-plugin-sdk-version.mjs` reports the surface change with a version
bump, and `check-npm-version-guard.mjs` passes (0.6.13 is not on npm).
- New kit tests cover the PATHEXT selection, the missing result when no
candidate is runnable, and the Windows installer command.
`packages/process-utils/test/portable-process.test.ts` has a
Windows-only test that launches a `.cmd` shim, kills it through the new
function, and checks the shim's child process is gone; it passes on the
VM (5 passed, 1 POSIX-only skipped) and a POSIX test pins the plain
signal.
- Real sessions, same VM, on an installed build that also contains the
other open Windows changes, after signing both CLIs in: a Codex thread
and a Claude Code thread each provisioned a worktree, ran the
repository's setup hook, and completed a turn. Each agent ran `bb
status` and reported its own thread id, created a file in the worktree,
and reported Windows PowerShell as its shell with the worktree as the
working directory.
Not verified: stopping a hung Codex or Pi session on Windows through the
app (the tree kill is covered by the test above, not by a hung
provider); the Pi CLI on Windows, which is not installed there; the
Claude Code PowerShell install action run from bb's Settings (I ran the
same installer by hand).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
> AGENT GENERATED
---------
Co-authored-by: Claude Code <[email protected]>
SawyerHood
added a commit
that referenced
this pull request
Oct 2, 2026
## Human comments
## What was wrong
bb's path model was POSIX-only, so a native Windows host could not add a
project or run a thread. `packages/domain/src/project-path.ts` rejected
every drive-letter path ("Native Windows paths are not supported"),
several server checks required `startsWith("/")`, and the worktree and
personal-workspace plugins built managed paths with `path.posix.join`,
which on Windows produced mixed separators
(`C:\…\host-data/worktrees/…`). Paths were also compared as raw strings,
so `C:\repo`, `c:/repo/`, and `C:\REPO` would have become separate
projects, environments, and path claims. The server joined host paths
with its own `node:path`, which is wrong whenever the server and the
host run different operating systems. Part of #1206.
## What changed
- **Domain.** New `packages/domain/src/host-path.ts`: pure string
helpers that infer POSIX or Windows from the path's shape and normalize,
join, take the directory or base name, compare, and test containment for
either. `project-path.ts` now accepts drive-letter paths and stores them
in one spelling (upper-case drive letter, backslashes, no trailing
separator). UNC paths are refused with a message that says to map a
drive. POSIX normalization is unchanged.
- **Server.** `update_environment_directory`, the environment provider
`existingPath` and `claimPath` results, and path admission accept any
absolute host path and canonicalize it. Thread storage, the
thread-storage orphan sweep, the host's `threadStorageRootPath`, the
diff-file route, workspace skills, and workspace `AGENTS.md` are joined
with the host path's own separator through `services/lib/host-path.ts`.
`isBbManagedWorkspacePath` uses the same helpers. Project create, source
create, and source update refuse a Windows path for a machine that
reported `darwin`, `linux`, or `wsl`, so that input still fails clearly
on existing hosts.
- **Contract.** The unmanaged workspace path in thread requests is
canonicalized at the boundary.
- **Database.** `packages/db/src/data/host-path-sql.ts` registers two
SQL functions on every connection, backed by the domain helpers:
`bb_host_path_key` (the case-folded comparison key) and
`bb_host_path_contains`. A Windows-shaped path is compared by key, so
letters outside ASCII fold too (`C:\src\Équipe` equals `C:\src\équipe`;
SQLite's `NOCASE` folds only ASCII). Containment no longer builds a
`LIKE` pattern from the stored path, so `_` and `%` in a directory name
are literal, for POSIX paths as well. POSIX equality is still an exact,
case-sensitive `=`. Used for project sources, environments, and path
claims. No schema change or migration.
- **Plugins.** `environment-git-worktree` and
`environment-personal-workspace` build managed paths with the host's
native `path.join`, and compare `git worktree list` output (which uses
`/` on Windows) through `path.relative`.
- **App.** `apps/app/src/lib/absolute-file-path.ts` and
`thread-local-file-links.ts` use the domain helpers, so a file link
under a Windows workspace root resolves to its workspace-relative path.
- **CLI.** `bb thread spawn --environment` recognizes `C:\…` and `c:/…`
as a path, not an ID.
- `docs/platform-support.md` documents the drive-letter rules.
No wire change: the daemon protocol and `HostPlatform` are untouched, so
a Windows daemon still reports `unknown`. Not included: Windows paths in
Markdown file links that agents print, drive switching in the remote
path browser, and the dialog placeholder text.
## How you verified
- Linux: `turbo run lint typecheck test` for `@bb/domain`, `@bb/db`,
`@bb/server-contract`, `@bb/server`, `@bb/cli`, `@bb/app`, and the two
environment plugins. 25 of 26 tasks passed in the combined run; the
server task had 4 failures of 3,226 tests (`machine-environment.test.ts`
timeout and three `plugin-native-server-loading.test.ts` cases) while
two other Turbo runs shared the machine. Both files pass when rerun
alone on this branch (5 of 5), and the second file is untouched by this
change.
- New tests, all runnable on Linux because the helpers do not use the
ambient `node:path`: `host-path.test.ts` (flavor, normalization,
comparison, containment, join), updated `project-path.test.ts` and
contract test, case-insensitive Windows lookups (including a non-ASCII
folder name), literal `_` and `%` in owned paths, and case-sensitive
POSIX lookups in `environments.test.ts`, managed-root detection for a
Windows data directory, two route tests (three spellings of one Windows
folder yield one project; a Windows folder is refused for a POSIX
machine), app path helper and file-link tests, and the CLI path
detection test.
- Windows 11 Enterprise VM (build 26300), on a branch with this change
on top of #4657 (which is needed to build on Windows at all): `bb
project create --root` with `C:\src\testrepo`, `c:/src/TestRepo/`, and
`C:\SRC\testrepo\.` returned the same project with source path
`C:\src\testrepo`; a UNC root returned HTTP 400 with the network-path
message; a worktree thread got the environment path
`C:\bb-data\plugins\environment-git-worktree\host-data\worktrees\thr_…-1\PlainRepo`
(all backslashes); two checkout threads started with `--environment
C:\src\plainrepo` and `--environment c:/SRC/plainrepo/` shared one
`project-checkout` environment; all three threads completed a turn.
`environments.test.ts` also passes on the VM (16 of 16).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
> AGENT GENERATED
---------
Co-authored-by: Claude Code <[email protected]>
SawyerHood
added a commit
that referenced
this pull request
Oct 2, 2026
## Human comments ## What was wrong `buildLifecycleScriptCommand` threw `POSIX shell setup scripts are not supported on Windows` for every `.bb-env-setup.sh` and `.bb-env-teardown.sh`. Setup failure fails provisioning, so on a native Windows host any repository that commits a setup hook could not start a worktree thread. Part of #1206. ## What changed - `apps/host-daemon/src/environment-lifecycle-script.ts`: on Windows the hook runs as `<bash> <script>` where bash is the one Git for Windows installs. `resolveWindowsBashPath` asks `git var GIT_SHELL_PATH` (the same lookup `runShellPipeline` already uses), prefers `bash.exe` in that directory, and falls back to the reported shell. That directory is put first on the hook's `PATH`, because a non-login Git bash does not otherwise find `head`, `touch`, or `bash` itself. - Timeout and cancellation on Windows stop every process the hook started. Git Bash launches programs such as `sleep` through a helper process that exits, so Windows no longer links them to the hook and `taskkill /T` from the hook's root misses them; they also keep the output pipes open, so the hook never returned. New `apps/host-daemon/src/git-bash-process-group.ts` asks Git Bash for the members of the hook's process group (`/proc/<pid>/pgid` and `winpid`), stops each member's tree with `taskkill`, and repeats until the group is empty. The POSIX path still kills the process group. - The hook only counts as stopped when that check comes back empty and the hook's own process exited. Otherwise, or when output stays open for 2 seconds after the stop, the run fails with `LifecycleScriptTerminationUnverifiedError` and `environment.hook.cancel` answers `unknown`, which the server already treats as cleanup-blocking. Before, the stop result was dropped and the cancel answered `terminated`. - Cancellation is checked again after the Git shell lookup, and the lookup itself takes the abort signal, so a hook cancelled during the lookup is not started. - `packages/process-utils`: `terminateWindowsProcessTrees` (the existing `taskkill` call, taking several roots) is exported for the above. - When Git reports no shell, the hook fails with `<script> needs Git for Windows: …` instead of the old unsupported-platform message. - `docs/worktrees.md`, `docs/platform-support.md`, and the `bb guide environments` template describe the Windows behavior. macOS and Linux still run `env bash <script>`; the command text and environment there are unchanged. No wire or CLI changes. ## How you verified - Windows 11 Enterprise VM (build 26300, Git for Windows 2.56.0), on a branch combining this change with #4657 and the Windows path change, since a worktree thread cannot be created on Windows without them: a repository with a tracked `.bb-env-setup.sh` (`echo hook-ran-in $(pwd) with $(bash --version | head -1)`, then `touch hook-marker.txt`) provisioned a worktree thread. The thread log showed `hook-ran-in /c/bb-data/…/testrepo with GNU bash, version 5.3.15`, `.bb-env-setup.sh finished (159ms)`, and `hook-marker.txt` existed in the worktree. - The same run before the `PATH` change failed with `head: command not found` and exit code 127, which is what the directory prefix fixes. - Cancellation, same VM, on a branch combining all the open Windows changes: - `vitest run src/environment-lifecycle-script.test.ts` in `apps/host-daemon` on Windows: 13 of 13 pass, including the setup and teardown timeout tests, the cancel test, and a new Windows-only test whose hook starts a background `sleep 120` and a background `node` process, is cancelled, and then finds neither process alive. Before the process-group change the timeout and cancel tests each ran into the 15 second test timeout, and a `sleep.exe` whose parent process no longer existed was still running after `taskkill /T /F` reported success. - In the running app: a worktree thread whose setup hook runs `sleep 300 &` and `sleep 300` showed two `sleep.exe` processes; `bb thread stop` left none, and no `bash.exe`, 800 ms later. - Linux: `turbo run lint typecheck test --filter=@bb/host-daemon --filter=@bb/process-utils` passes (10 of 10 tasks). The unit tests cover the Windows command, its `PATH` prefix, the missing-bash message, the rule that only a confirmed stop is accepted, and that a cancel whose stop is unconfirmed answers `unknown`. Not verified: the teardown hook on Windows through the app (only through `runTeardownScript` in the tests above); a hook that leaves a background program running after its own shell exits within the first moments of the run, where the process group lookup may not have finished and the stop reports unverified. The Windows-only test runs only on a Windows machine; CI does not run the host daemon tests on Windows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED --------- Co-authored-by: Claude Code <[email protected]>
SawyerHood
added a commit
that referenced
this pull request
Oct 2, 2026
## Human comments
## What was wrong
The desktop app could not be built for Windows, and a Windows build
would have misbehaved:
- `run-electron-builder.mjs` spawned
`node_modules/.bin/electron-builder`, which on Windows is a
`.cmd`/`.ps1` shim that `spawn` cannot execute; the script exited 1 with
no output.
- `electron-builder.config.json` had no Windows target, `afterPack`
computed a Linux-style binary path, and the release-channel helpers
threw for `win32`.
- electron-builder left `@parcel/watcher-win32-x64` out of the package,
so the daemon's file-watcher child crashed in a loop ("No prebuild or
local build of @parcel/watcher found").
- `resolveBbDesktopPlatform` mapped every non-macOS platform to `linux`,
so a Windows build would read the Linux version feed and announce Linux
releases.
- A one-click per-user NSIS install used the sanitized package name as
its directory: `%LOCALAPPDATA%\Programs\@bbdesktop`.
Part of #1206. Stacked on #4657, which is what lets bb build and start
on Windows at all.
## What changed
- `run-electron-builder.mjs` runs electron-builder's `cli.js` with
`process.execPath` on every platform. For `--win` it sets the
per-channel icon and `extraMetadata.name` (`bb` / `bb-nightly`) so the
install directory is `%LOCALAPPDATA%\Programs\bb`.
- `electron-builder.config.json` gains an x64 NSIS target (`oneClick`,
per-user). `apps/desktop` declares `win32` in `os`, and adds
`package:win` and `desktop:build:win` with matching Turbo tasks. `pnpm
desktop` resolves `package:win` on Windows.
- `prepare-native-modules.cjs` (`afterPack`): uses `<productName>.exe`
on Windows, copies the platform `@parcel/watcher-<platform>-<arch>`
package from the workspace when the packaged app lacks it (macOS and
Windows; Linux names carry a libc suffix and are left to
electron-builder), and loads that binary with the packaged Electron
version. A package without `@parcel/watcher` now fails the build.
- New `windows` value in `bbDesktopVersionFeedPlatformSchema` with
`desktop-version-windows.json`; `latest.yml` / `nightly.yml` are the
updater metadata names. `resolveDesktopUpdateSupport` turns both the
version check and auto-update off on Windows, because no Windows feed is
published.
- `smoke-packaged-app.mjs` and `packaged-app-paths.mjs` handle
`win-unpacked\bb.exe`.
- The `Windows app smoke` CI job now also runs `package:win` and
`smoke:packaged`; its timeout goes from 25 to 40 minutes.
- `apps/desktop/README.md` documents Windows packaging.
Not included: a published Windows release (no change to
`build-desktop.yml` or the nightly workflow), code signing, auto-update,
and `bb-app`'s npm `os` field.
## How you verified
On a Windows 11 Enterprise VM (build 26300), with this branch (which
contains #4657):
- The three CI steps in order: `turbo run smoke:boot --filter=bb-app`
passed (49 s); `turbo run package:win --filter=@bb/desktop` passed (102
s), including `afterPack`'s packaged-npm check with Electron 44.3.0;
`turbo run smoke:packaged --filter=@bb/desktop --force` printed
`Packaged desktop smoke passed: …\release\win-unpacked\bb.exe`.
- `desktop:build:win` produced `bb-0.44.0-x64.exe` (175 MB) and
`latest.yml`. A silent install (`/S`) created
`%LOCALAPPDATA%\Programs\bb\bb.exe`, a Start Menu shortcut, and an
uninstall entry. The installed app started its server and daemon, showed
the main window, and two watcher child processes were running; the
earlier build without the watcher package logged the "No prebuild" error
on every respawn.
- Closing the main window left zero `bb.exe` processes after 15 s.
Force-killing only the main process also left zero after 12 s, and the
next launch started normally.
- Before the directory-name change the same installer created
`%LOCALAPPDATA%\Programs\@bbdesktop`.
On Linux: `turbo run lint typecheck test --filter=@bb/desktop
--filter=@bb/desktop-contract --filter=@bb/scripts` passes (11 of 11
tasks). New tests cover the Windows platform mapping, update support,
the printed builder config for `--win` on both channels, the Windows
launch arguments, and the packaging task name.
Not verified: the macOS path through the new watcher copy and load check
(it runs only when the package lacks the platform package, and I have no
macOS host here); the Windows build on the CI runner, which this PR's
run will show.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
> AGENT GENERATED
Co-authored-by: Claude Code <[email protected]>
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.
Human comments
What was wrong
bb could not start on native Windows. The plugin manifest containment check compared the resolved entry against
rootDir + "/", so on Windows (wherepath.resolvereturns backslashes) everybb.server,bb.host,bb.app, and asset entry was reported as escaping the plugin directory. The build failed in every plugin'sprepare:bundled, and a server would have loaded no plugins, which means no providers. Separately, the bundledbbCLI is an extensionless script with a#!/usr/bin/env nodeshebang; Windows cannot execute that, sobbfailed withspawn …\host-daemon\dist\bb ENOENTfrom the launcher and from theBB_CLIre-exec, and agent shells had nobbon PATH. Part of #1206.What changed
packages/plugin-build/src/plugin-manifest.tsandapps/server/src/services/system/code-themes.tscheck containment withisPathWithinDirectoryfrom@bb/process-utilsinstead of a/-suffix string prefix. Behavior on macOS and Linux is unchanged.packages/bb-app/src/launcher.ts(runBundledCliCommand) andapps/cli/src/bb-cli-reexec.tsrun the CLI throughprocess.execPathwhen the platform is Windows and the target has no extension. A target that Windows can execute (for example aBB_CLIoverride pointing at an.exe) is still spawned directly.apps/host-daemon/scripts/build-bundles.mjswritesbb.cmdnext todist/bb.packages/bb-applists it infiles, andbuild-host.mjscopies it into the enrolled-host package. The directory is the one the daemon already prepends to agent PATH, so PowerShell andcmd.exeresolvebb.packages/bb-app/scripts/smoke-boot.mjs(smoke:bootTurbo task): starts the built launcher on free ports with a temporary data directory, waits for/health, runsbb statusthrough the bundled CLI, waits for the expected built-in plugins to berunning, checks the daemon connected, stops the process tree, and confirms the server stopped answering.Windows app smoke (Node 22.x)on the same Blacksmith Windows runner as the existing Windows job; it installs with--ignore-scriptsand runssmoke:boot. This adds a second Windows runner job per pull request.docs/windows-ci.mddocuments the smoke and thebb.cmdshim.No wire, CLI flag, or configuration changes.
bb-appstill declaresos: ["darwin", "linux"]; this PR does not make Windows a supported install target.How you verified
On a Windows 11 Enterprise VM (build 26300, Node 22.23.3, Git for Windows 2.56.0), from this branch at
origin/maina7222622a0:pnpm install --frozen-lockfile --ignore-scriptsthenpnpm exec turbo run smoke:boot --filter=bb-app: 55 of 55 tasks, smoke passed in 72 s (server healthy, bundled CLI answeredbb status, 33 plugins listed with the expected built-ins running, daemon connected).manifest bb.server escapes the plugin directory: "./src/server.ts"in the pluginprepare:bundledtasks.launcher.tsreverted: the smoke fails withspawn C:\src\bb\packages\bb-app\host-daemon\dist\bb ENOENT.On Linux:
pnpm exec turbo run smoke:boot --filter=bb-apppasses;turbo run lint typecheck testfor@bb/plugin-build,@bb/cli,bb-app, and@bb/host-daemonpasses (14 of 14 tasks);turbo run lint typecheck --filter=@bb/serverpasses. New unit tests cover the Windows launch decision in both the launcher and the CLI re-exec, and thebb.cmdentry in the package file list.Not verified here: the new CI job itself has not run yet; this PR is its first run.
🤖 Generated with Claude Code