You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds managed web browser lifecycle protection for agent-device-owned agent-browser Chrome fleets.
Sets a five-minute managed agent-browser idle timeout by default, with AGENT_BROWSER_IDLE_TIMEOUT_MS and AGENT_DEVICE_WEB_IDLE_TIMEOUT_MS overrides.
Tags managed Chrome launches and reaps only Chrome-like processes that carry the tag or run from the managed agent-device browser home during daemon startup.
Adds a doctor check that reports the live agent-device-owned Chrome process count and PIDs.
Residual risk: orphan detection intentionally stays conservative. It will not touch ordinary user Chrome, but it may leave behind a process if its command line no longer contains the launch marker or managed browser-home path.
Touched files: 8; scope stayed within web lifecycle/doctor handling.
Validation
pnpm check:quick
pnpm format
./node_modules/.bin/vitest run src/platforms/web/agent-browser-lifecycle.test.ts src/platforms/web/agent-browser-tool.test.ts src/platforms/web/agent-browser-provider.test.ts src/daemon/handlers/tests/session-doctor-web.test.ts
Follow-up issue #1123 is an actionable blocker for this PR as currently scoped: the daemon startup reaper should avoid killing managed browsers still owned by active/recent sessions, and provider-startup/process-tree cleanup gaps need addressing or explicit deferral before this is merge-ready.
Review pass after 0826306: no remaining actionable blockers found.
Checked against #1123 and the prior PR blocker. The reaper now skips when session ownership reports open web sessions or recent managed browser activity, narrows process matching to the managed browser subtree or explicit launch marker, expands cleanup to the matched browser process tree, and wires provider-startup cleanup with debounce. The new tests cover skip decisions, process-tree signaling, provider-startup wiring, and daemon-startup session-store integration.
CI is green, and the worker validation included focused lifecycle/provider/runtime tests, format, quick checks, build, smoke, and unit. Marking this ready for human maintainer judgment.
Preview removed because the pull request was closed.
2026-07-06 13:51 UTC
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
ready-for-humanValid work that needs human implementation, judgment, or maintainer merge
1 participant
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.
Summary
Adds managed web browser lifecycle protection for agent-device-owned agent-browser Chrome fleets.
Closes #1109
Residual risk: orphan detection intentionally stays conservative. It will not touch ordinary user Chrome, but it may leave behind a process if its command line no longer contains the launch marker or managed browser-home path.
Touched files: 8; scope stayed within web lifecycle/doctor handling.
Validation