Skip to content

feat(council): queue_monitor persistent background service (--daemon + installer)#54

Merged
intellegix merged 1 commit into
masterfrom
feature/queue-monitor-daemon
Jul 15, 2026
Merged

feat(council): queue_monitor persistent background service (--daemon + installer)#54
intellegix merged 1 commit into
masterfrom
feature/queue-monitor-daemon

Conversation

@intellegix

Copy link
Copy Markdown
Owner

What

Makes queue_monitor.py runnable as a persistent background service for live Pushover alerts on the Perplexity research FIFO queue, and adds the Task Scheduler installer.

Why

queue_monitor.py is a persistent poll loop — its tail offsets and per-key alert dedup live in-process, and --once seeds 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 --daemon flag + _harden_for_windows_daemon() (redirects stdout/stderr to ~/.claude/logs/queue_monitor.log so a pythonw run, whose console fds are discarded, stays diagnosable). Mirrors browser_bridge_keeper._harden_for_windows_daemon. Additive: interactive python queue_monitor.py is unchanged; hardening only fires under --daemon.
  • install_queue_monitor_task.ps1 (new) — registers PerplexityQueueMonitor as a persistent pythonw daemon (--daemon --interval 15). AtLogOn + 5-min repetition with MultipleInstances=IgnoreNew: the repetition is a watchdog (relaunch if dead) that never spawns a duplicate. Interactive/Limited principal, restart-on-failure, no time limit; -Uninstall / -NoPushover switches. Sibling of install_bridge_keeper_task.ps1.

Verification

  • python -m py_compile queue_monitor.py
  • test_queue_monitor.py + test_queue_monitor_stall.py: 30 passed
  • Live: task registers without elevation; daemon runs under pythonw, polls every 15s, and writes the poll table to queue_monitor.log.

🤖 Generated with Claude Code

…--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
@intellegix
intellegix merged commit 502b3c7 into master Jul 15, 2026
5 checks passed
@intellegix
intellegix deleted the feature/queue-monitor-daemon branch July 15, 2026 12:02
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