Skip to content

fix(browser): force-kill Chrome after headful session - #6

Merged
intellegix merged 1 commit into
masterfrom
fix/chrome-cleanup-headful
Feb 23, 2026
Merged

fix(browser): force-kill Chrome after headful session#6
intellegix merged 1 commit into
masterfrom
fix/chrome-cleanup-headful

Conversation

@intellegix

Copy link
Copy Markdown
Owner

Summary

  • Headful Chrome windows sometimes survive Playwright's graceful close, blocking subsequent /research-perplexity calls
  • Snapshots Chrome PIDs before/after browser launch to track which processes we spawned
  • After graceful shutdown (1s grace), force-kills any surviving Chrome processes via taskkill /F /PID /T
  • Wraps playwright.stop() in try/except to prevent blocking semaphore release

Test plan

  • Syntax check passes
  • Run /research-perplexity with --headful and verify Chrome window closes automatically
  • Run two consecutive /research-perplexity calls — second should not get BROWSER_BUSY

🤖 Generated with Claude Code

When using --headful mode, Chrome windows sometimes survive Playwright's
graceful context.close() + browser.close() + playwright.stop(). This
blocks subsequent research queries via SessionSemaphore conflicts.

Fix: snapshot Chrome PIDs before/after browser launch, then force-kill
any that survive the graceful shutdown (1s grace period). Also wraps
playwright.stop() in try/except to prevent it from blocking semaphore
release and temp dir cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@intellegix
intellegix merged commit cc1edd6 into master Feb 23, 2026
5 checks passed
@intellegix
intellegix deleted the fix/chrome-cleanup-headful branch February 25, 2026 19:17
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