Skip to content

(browser): add the managed-browser lifecycle library (#812) - #1052

Merged
devsuitup merged 3 commits into
mainfrom
wt/812-s2
Nov 9, 2026
Merged

devsuitup merged 3 commits into
mainfrom
wt/812-s2

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Slice S2 of #812: the managed-browser lifecycle library. Nothing calls it yet: no settings, IPC, UI or session injection (later slices).

  • src/main/browser/: an Electron-free manager. On Linux it discovers a Chromium (ELF only, so a distribution wrapper script is refused with the real binary to configure), keeps the profile in a 0700 directory owned by the user, and records the browser in a state file with a lock. Identity is checked by executable, profile argument, start time and boot ID before any signal. A reused PID or a new boot resets the state; an ambiguous launch is adopted or cleared. On other platforms every operation returns unsupported without spawning.
  • Quit: shutdownForExit stops a browser this instance started, before the database drain, inside a try/catch so it cannot block quit.
  • scripts/test-pr.js: an isolated instance's browser is stopped and its data removed with the rest of the instance.
  • Tests use a fake Chromium and injected process/fs seams: managed-browser, managed-browser-boundaries, managed-browser-shutdown, plus updated shutdown fixtures (each only adds the new managedBrowser stub) and test-pr.

Docs: .ai/contexts/managed-browser.md.

Not verified here: real Linux procfs and systemd behaviour (including $ escaping under systemd-run --scope), a real Chromium.

An Electron-free manager discovers a Linux Chromium, keeps its profile
in a protected directory, tracks it through a state file and lock, and
stops it on quit; test-pr cleans up an isolated instance's browser.
Nothing calls it yet.
A reused PID or another boot no longer blocks the manager, a pending
launch is adopted or cleared, only verified browser processes are
signalled, and the quit hook cannot block shutdown.
@devsuitup devsuitup added the no-changelog The PR changes nothing a user sees; the CHANGELOG.md check is waived label Nov 9, 2026
@devsuitup
devsuitup merged commit a66bdda into main Nov 9, 2026
10 checks passed
@devsuitup
devsuitup deleted the wt/812-s2 branch November 9, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog The PR changes nothing a user sees; the CHANGELOG.md check is waived

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant