Skip to content

Open in Explorer, Keep Awake, logs, and the browser broker on Windows - #4732

Merged
SawyerHood merged 4 commits into
mainfrom
bb/windows-os-integrations-thr_jensq3v9th
Oct 2, 2026
Merged

SawyerHood merged 4 commits into
mainfrom
bb/windows-os-integrations-thr_jensq3v9th

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Four desktop and host integrations had only macOS or Linux code paths. Part of #1206.

  • Open in…: listWorkspaceOpenTargetsWithRuntime returned an empty list for any platform other than macOS and Linux, and opening returned unsupported_platform, so "Open in editor", "Reveal", and "Open in terminal" did nothing on Windows.
  • Keep Awake only spawned caffeinate; on Windows it logged a warning and did nothing.
  • Server & Daemon Logs: the menu item was enabled on macOS only, and the viewer read logs by spawning tail, which Windows does not have.
  • Desktop browser broker: the desktop refused the daemon's broker descriptor unless its mode had no group or other bits. Windows reports 0666 for every file, so the desktop never connected to the broker and agents could not drive the built-in browser.

What changed

One commit per integration:

  • packages/local-open-targets: Windows lists editors whose CLI is on PATH (found with where.exe, launched through the portable launcher so .cmd shims work), the default app, File Explorer, and Windows Terminal, or PowerShell when Windows Terminal is absent. Paths reach PowerShell through an environment variable, so no path is quoted onto a command line. A file reveals with explorer /select; a remote SSH terminal is still Linux and macOS only.
  • plugins/keep-awake: on Windows the host worker starts a PowerShell process that holds ES_CONTINUOUS | ES_SYSTEM_REQUIRED until the worker exits. A helper that exits straight away is now restarted with a growing delay (1 s doubling to 60 s) on every platform, so a machine where it cannot run is not polled every second. UI copy, CLI summary, and the plugin overview say macOS and Windows, and the plugin-build test that pins the built-in's supported flag expects it on Windows.
  • apps/desktop: new log-file-follower.ts follows a log file from Node (last lines first, then appended bytes, restart on truncation). The log viewer uses it on Windows and keeps tail elsewhere; the menu item and app command are enabled on Windows.
  • apps/desktop/src/desktop-browser-broker-client.ts: the mode and owner checks apply only where POSIX permissions exist. The regular-file and size checks apply everywhere. On Windows the descriptor lives under the user profile, which other users cannot read by default.

How you verified

  • Windows 11 Enterprise VM (build 26300), on a branch combining this with the other open Windows changes:
    • The daemon's /workspace-open-targets listed Default App, File Explorer, and Windows Terminal. POST /open-in-target for a folder and a file under C:\bb-setup\open test & dir\it's a file.txt returned 200 for each target; Notepad started with that exact path and a Windows Terminal window opened. A missing path returned 400.
    • After bb keep-awake enable, powercfg /requests listed the PowerShell helper under SYSTEM.
    • In the installed desktop build, bb browser instances listed the desktop window, which requires the broker connection.
    • log-file-follower.test.ts, log-viewer.test.ts, and the broker descriptor test pass on the VM.
  • Linux: new tests for the Windows target list and invocations (including that the path variable survives the daemon's environment sanitizer), the Windows keep-awake command and restart backoff, the follower, and the descriptor check. On this branch before the last rebase, turbo run lint typecheck test --filter='...[origin/main]': 24 of 24 tasks passed. After the rebase onto current main, lint and typecheck pass for the same filter.

Not verified: the Server & Daemon Logs window was not opened by hand in the Windows app; opening a path in VS Code or another editor on Windows (none is installed on the VM, so only the unit tests cover the editor command).

🤖 Generated with Claude Code

AGENT GENERATED

@SawyerHood
SawyerHood marked this pull request as ready for review October 2, 2026 16:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T16:55:09.117864Z 4f4228d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

SawyerHood and others added 4 commits October 2, 2026 17:25
…dows

The open-targets list was empty on Windows and opening returned
unsupported_platform. Windows now lists editors whose CLI is on PATH,
the default app, File Explorer, and Windows Terminal (PowerShell when it
is absent). Paths reach PowerShell through an environment variable, so
no path is quoted onto a command line.

Co-Authored-By: Claude Code <[email protected]>
Keep Awake only ran caffeinate on macOS. On Windows it now starts a
PowerShell process that holds a system-required execution state until the
plugin's worker exits. A child that exits straight away is restarted with
a growing delay, so a machine where the helper cannot run is not polled
every second.

Co-Authored-By: Claude Code <[email protected]>
The desktop refused the broker descriptor unless its mode had no group or
other bits. Windows reports 0666 for every file, so the desktop never
connected to the daemon's browser broker there. The mode and owner checks
now apply only where POSIX permissions exist; the regular-file and size
checks still apply everywhere.

Co-Authored-By: Claude Code <[email protected]>
The log viewer was enabled only on macOS and read logs by spawning tail,
which Windows does not have. On Windows it now follows the log file from
Node (last lines first, then appended bytes, restarting on truncation),
and the View menu item and app command are enabled there.

Co-Authored-By: Claude Code <[email protected]>
@SawyerHood
SawyerHood force-pushed the bb/windows-os-integrations-thr_jensq3v9th branch from 4f4228d to fd28e91 Compare October 2, 2026 17:29
@SawyerHood
SawyerHood merged commit 5acb6a1 into main Oct 2, 2026
27 checks passed
@SawyerHood
SawyerHood deleted the bb/windows-os-integrations-thr_jensq3v9th branch October 2, 2026 18:08
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.

1 participant