Skip to content

Fix watcher shutdown lifecycle - #7

Merged
Way-To-AGI merged 1 commit into
mainfrom
agent/fix-watcher-shutdown
Jul 21, 2026
Merged

Fix watcher shutdown lifecycle#7
Way-To-AGI merged 1 commit into
mainfrom
agent/fix-watcher-shutdown

Conversation

@Way-To-AGI

Copy link
Copy Markdown
Owner

What changed

  • enforce one Theme Studio watcher per CDP port with an atomic private lock
  • reconcile and stop only exact validated watcher commands, including orphaned duplicates
  • make signal, API, and renderer-disappearance shutdown release sessions, control server, state, and lock deterministically
  • prune closed CDP sessions during theme switches
  • add lifecycle regression coverage and update runtime/QA documentation

Root cause

Restore deleted the single watcher state shortly after SIGTERM without confirming process exit. Older detached watchers became undiscoverable, so repeated starts accumulated CDP and loopback connections that could interfere with Codex graceful quit.

Validation

  • node scripts/self-test.mjs
  • node scripts/studio-protocol-test.mjs
  • node scripts/theme-control-test.mjs
  • node scripts/usage-provider-test.mjs
  • node scripts/platform-runtime-test.mjs
  • node scripts/runtime-lifecycle-test.mjs
  • quick_validate.py
  • cleaned three existing orphan watchers and verified state/lock removal

@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Way-To-AGI
Way-To-AGI merged commit 135b7fb into main Jul 21, 2026
4 checks passed
@Way-To-AGI
Way-To-AGI deleted the agent/fix-watcher-shutdown branch July 21, 2026 10:08
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