Skip to content

Recognize and safely close automation Chrome sessions - #17

Open
SonghaiFan wants to merge 1 commit into
mainfrom
codex/automation-chrome-cleanup
Open

SonghaiFan wants to merge 1 commit into
mainfrom
codex/automation-chrome-cleanup

Conversation

@SonghaiFan

Copy link
Copy Markdown
Owner

What changes

Playwright can leave dedicated Chrome sessions running without a TCP listener, so LeftOpen's port list cannot show or close them. Add an Automation browsers section to the menu app, with individual review and close actions using the existing ClosePlan, confirmation page and expiring ForceCloseOffer.

Recognition requires the Chrome main executable, the current user's dedicated Playwright temporary profile, and exact kernel argv flags for no startup window and a debugging pipe. Normal profiles and browser helpers are excluded. Before signaling, recheck the PID, UID, microsecond start identity, executable and profile; confirm actual process exit independently of sockets. Force close remains an explicit action after an unsuccessful gentle close.

Task activity remains unknown: these entries are not automatically labeled abandoned or closed based on age. Project batch close does not include browsers. Includes English/Chinese UI, documentation and focused regression tests.

Validation

  • Passed all 87 Swift tests on this PR branch with LEFTOPEN_TEST_CHROME=1 swift test, including a real isolated Chrome session and a control profile. The recognized session exits while the control remains running.
  • Regression coverage includes ordinary profiles, helpers, duplicate/malformed flags, symlink escapes, changed identities, unknown outcomes and force-close eligibility/expiry.
  • The local implementation was also packaged as an ad-hoc signed Universal app; installed App/CLI hashes and signatures were verified, and the user successfully closed two test sessions through LeftOpen.
  • Inspected native list/review snapshots in light and dark appearances.
  • git diff --check.

Boundaries

Browser cleanup is exposed in the menu app; the CLI retains its port-oriented commands. LeftOpen does not delete temporary profiles or Dock recent-app shortcuts. The test launchers own their temporary-directory cleanup. Manual testing reproduced a Chrome recent-app Dock entry remaining after confirmed process exit; that is a separate follow-up, not a failed process close.

This branch has not been deployed

No deployments
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