feat(council): queue_monitor persistent background service (--daemon + installer)#54
Merged
Merged
Conversation
…--daemon + installer) queue_monitor.py is a persistent poll loop (in-process tail offsets + per-key alert dedup; --once seeds at EOF and detects nothing), so live monitoring needs a long-lived daemon rather than the one-shot pattern the keepers use. - queue_monitor.py: add --daemon flag + _harden_for_windows_daemon() that redirects stdout/stderr to ~/.claude/logs/queue_monitor.log, so a pythonw Task Scheduler run (whose console fds are discarded) stays diagnosable. Mirrors browser_bridge_keeper._harden_for_windows_daemon. Additive: an interactive `python queue_monitor.py` run is unchanged (still prints to console); hardening only fires under --daemon. - install_queue_monitor_task.ps1: register PerplexityQueueMonitor as a persistent pythonw daemon (--daemon --interval 15). AtLogOn trigger + 5-min repetition with MultipleInstances=IgnoreNew: the repetition is a watchdog (relaunch if dead) that never spawns a duplicate while the daemon is alive. Interactive/Limited principal, restart-on-failure, no time limit; -Uninstall and -NoPushover switches. Sibling of install_bridge_keeper_task.ps1. Verified live: task registers without elevation, daemon runs (pythonw), polls every 15s, and writes the poll table to queue_monitor.log. Existing monitor suites still green (test_queue_monitor + _stall: 30 passed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpuwG5kvGqBwZtCKTSdAK6
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Makes
queue_monitor.pyrunnable as a persistent background service for live Pushover alerts on the Perplexity research FIFO queue, and adds the Task Scheduler installer.Why
queue_monitor.pyis a persistent poll loop — its tail offsets and per-key alert dedup live in-process, and--onceseeds at EOF so it detects nothing. So live monitoring needs a long-lived daemon, unlike the one-shot keepers that rely on task repetition.Changes
queue_monitor.py— add--daemonflag +_harden_for_windows_daemon()(redirects stdout/stderr to~/.claude/logs/queue_monitor.logso apythonwrun, whose console fds are discarded, stays diagnosable). Mirrorsbrowser_bridge_keeper._harden_for_windows_daemon. Additive: interactivepython queue_monitor.pyis unchanged; hardening only fires under--daemon.install_queue_monitor_task.ps1(new) — registersPerplexityQueueMonitoras a persistentpythonwdaemon (--daemon --interval 15). AtLogOn + 5-min repetition withMultipleInstances=IgnoreNew: the repetition is a watchdog (relaunch if dead) that never spawns a duplicate. Interactive/Limited principal, restart-on-failure, no time limit;-Uninstall/-NoPushoverswitches. Sibling ofinstall_bridge_keeper_task.ps1.Verification
python -m py_compile queue_monitor.py✅test_queue_monitor.py+test_queue_monitor_stall.py: 30 passed ✅pythonw, polls every 15s, and writes the poll table toqueue_monitor.log.🤖 Generated with Claude Code