Skip to content

fix(drivers): Electron app window, first page load limit, no npx env in app commands - #213

Merged
merge-loop[bot] merged 5 commits into
mainfrom
cb/electron-app-window
Nov 19, 2026
Merged

merge-loop[bot] merged 5 commits into
mainfrom
cb/electron-app-window

Conversation

@cjber

@cjber cjber commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
flowchart LR
  npx["npx bugpatrol"] -->|drops npm_* env| cmds["prepare, setup, verify commands"]
  cfg["app.connect"] -->|loadTimeoutMs| web["WebDriver first page.goto"]
  cfg -->|"window, captures resolved"| el["ElectronDriver: page choice and window action"]
Loading

Three driver and launch fixes for apps Bugpatrol could not test.

Scope

Drivers (web.ts, electron.ts, factory.ts), config schema, CLI entry, docs/configuration.md. Nothing in the request deny list.

Verification

  • pnpm gate and pnpm gate:changed (biome, knip, tsc, vitest on changed files: 112 tests).
  • New tests: an invalid substituted connect.window is a ConfigError without the capture; an overlay with focus beside the main window; a window action toward the excluded overlay is refused; connect.window captures resolve in the factory; a slow first response loads within loadTimeoutMs and fails past it with the setting named; dropLauncherEnv drops npm_* and keeps other variables.
  • Bugpatrol run: skipped, this repository is Bugpatrol itself and the change is covered by driver tests.

Reviews

Codex and Muse reviewed the diff and exchanged exclusive findings; outcomes are in the PR conversation. Fixed: captures kept out of the no-page error, an invalid substituted pattern is a ConfigError, docs scoped.

Risks

  • npm_* variables are gone for every command Bugpatrol runs, including a fixer's verify. A package manager the app's command starts sets its own; .npmrc and uppercase NPM_CONFIG_* still apply.
  • loadTimeoutMs is unset by default, which keeps Playwright's 30 s.

Closes #212
Closes #211
Closes #210

🤖 Generated with Claude Code

…ever driven

An app that keeps a small always-on-top window open beside its main
window, such as Nebula Desktop's Push to talk capsule, could have that
window chosen as the app page: both are visible app pages, and on Linux
the overlay can hold focus. Every replay of a review then captured the
overlay.

connect.window is a regex the main window's URL matches; only a matching
page is driven and captured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KXatHM4A5GhLuX4NoAaXYm
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bugpatrol Ready Ready Preview Nov 19, 2026 2:21am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T17:08:27.897940Z 0ca4b30 PR opened
ℹ️ 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.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Bugpatrol review: fixture-app

No problem introduced · tested 02540d7 against main d6c4351

Tested

  • Home (index.html)
  • Settings (/settings, via nav link)

Not tested

  • The rest of the change: outside the fixture app

Updated on each push. Tests only what the diff can affect. Does not block the merge.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Bugpatrol review: dashboard

No problem introduced · tested 02540d7 against main d6c4351

Tested

  • Overview (issues, judge queue, live session, coverage)
  • Issues list and issue detail with proposed fix diff, fix attempts, retest
  • Coverage, Reviews, Activity, Flow, Screens, Memory pages all load

Not tested

  • The rest of the change (driver connect.window, loadTimeoutMs, dropLauncherEnv, config schema fields): outside the dashboard: drivers and CLI are not rendered or run by the dashboard; fixture data unaffected

Updated on each push. Tests only what the diff can affect. Does not block the merge.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ca4b300e5

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/drivers/src/electron.ts Resolved
Comment thread packages/drivers/src/factory.ts Resolved
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Bugpatrol review: cli

No problem introduced · tested 02540d7 against main d6c4351

Tested

  • CLI entry dropLauncherEnv: setup command saw 0 npm_* vars; NPM_CONFIG_*/PATH kept
  • doctor config validation: loadTimeoutMs 0/1.5 rejected, 180000 ok; invalid connect.window regex rejected
  • WebDriver first load: InfrastructureError naming app.connect.loadTimeoutMs past limit; loads within it (real Chromium)
  • WebDriver window action: found / Not switched messages (real browser)
  • ElectronDriver page choice: overlay ignored, connect to named window, refused switch says Not switched, allowed switch ok (CDP)
  • Factory: captures substituted into connect.window; invalid substituted pattern is ConfigError naming app.connect.window, no secret leaked
  • CLI replay end to end: web routine and electron routine with connect.window
  • Vitest on the PR's four changed test files: 41 passed
  • issue list / memory add, list, remove through the changed CLI entry

Not tested

  • Electron private launch (connect.launch) with connect.window: needs a real Electron app binary; same windowPattern/appPage code verified over cdp connect
  • web connect.window silently accepted (matches pre-existing web+cdp leniency): consistent with existing schema design, not introduced by this PR
  • readOnly mode combined with loadTimeoutMs: same page.goto call; covered by the PR's unit tests

Updated on each push. Tests only what the diff can affect. Does not block the merge.

cjber and others added 3 commits November 19, 2026 02:09
npx sets npm_config_user_agent and other npm_ variables for Bugpatrol's own
process, and every prepare, setup and verify command inherited them, so an
only-allow guard in the app's preinstall saw npm and refused. Bugpatrol now
drops them at startup, before it runs anything.

Closes #210

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ow switch

- connect.loadTimeoutMs sets how long a web app's first page load may take,
  for a dev server that builds the app on its first request (Metro for Expo
  web). A timeout is an infrastructure error that names the setting.
- connect.window now also bounds the explorer's window action, so it cannot
  switch to the overlay the pattern leaves out.
- connect.window resolves setup captures before it compiles, like the other
  connect strings.

Closes #211

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cjber cjber changed the title fix(electron): let the config name the app window, so an overlay is never driven fix(drivers): Electron app window, first page load limit, no npx env in app commands Nov 19, 2026
…an invalid one as config

A setup capture is a secret, and the no-page error printed the compiled
pattern with the capture in it. A capture that made the pattern invalid
threw a bare SyntaxError, read as an infrastructure failure; it is now a
ConfigError naming app.connect.window. Docs scope loadTimeoutMs to the
explorer, say the window pattern applies at connect and on a switch, and
say every lowercase npm_ variable is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cjber

cjber commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Codex (gpt-reserve, xhigh) and Muse reviewed git diff origin/main...HEAD at 105a7fa, then exchanged exclusive findings once.

Fixed in 02540d7:

  • The no-page error printed the compiled connect.window regex, which holds resolved setup captures (secrets). It now says "matching app.connect.window". (Codex, confirmed by Muse)
  • A capture that made the pattern invalid threw a bare SyntaxError (exit 4). It is now a ConfigError naming app.connect.window, without the value, with a test. (both)
  • Docs: loadTimeoutMs scoped to the explorer's first load; the window pattern applies at connect and on a switch; every lowercase npm_* variable is dropped, stated plainly. (Muse, confirmed by Codex)

Not changed, with reasons:

  • bugpatrol run (tier 1 capture, capture.ts:37) does not read connect.loadTimeoutMs: that path loads run.url under the run block and its own readiness, not app.connect; Web review fails on a dev server that builds its bundle on first load: fixed 30 s page.goto limit #211 is the explorer's first load. The docs claim that implied otherwise is fixed.
  • Read-only reload of every app page on Electron connect stays: it applies the WebSocket routes to each page of the app, an excluded overlay included, so its writes are held back too.
  • open may move the chosen window to a URL the pattern does not match: connect.window chooses a window, and that window then moves through the app's routes (taps navigate it the same way). Refusing open alone would block normal routes of the main window under a tight pattern such as /chat$.
  • npm_* stripping stays whole: a launcher-set npm_config_* cannot be told from a user-exported one, and npm itself rebuilds them for any npm command the app runs.

@joaquim-verges joaquim-verges added the mergepatrol Queue this PR: Mergepatrol rebases, tests and merges it label Nov 19, 2026 — with Nebula AI Agent
@merge-loop

merge-loop Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Merged as 2c57911.

@merge-loop merge-loop Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MergeLoop's review approves 02540d7: nothing it found holds this PR.

@merge-loop
merge-loop Bot merged commit 2c57911 into main Nov 19, 2026
12 checks passed
@merge-loop merge-loop Bot removed the mergepatrol Queue this PR: Mergepatrol rebases, tests and merges it label Nov 19, 2026

This branch was successfully deployed

1 active deployment
Preview — 02540d71 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants