-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
The Panopticon dashboard shows the test-agent (and potentially other specialists) as "active" with a spinner, even when they are sitting idle at a prompt.
Root Cause
The heartbeat hook (~/.panopticon/bin/heartbeat-hook) line 26:
AGENT_ID="${PANOPTICON_AGENT_ID:-$(tmux display-message -p '#S' 2>/dev/null || true)}"When running Claude Code outside of tmux (e.g., in VS Code integrated terminal), tmux display-message -p '#S' still returns a session name from the tmux server - typically the most recently active session. In this case, it returns specialist-test-agent.
This causes the main CLI tool activity to be written to ~/.panopticon/heartbeats/specialist-test-agent.json, making the dashboard think the test-agent is actively working.
Reproduction:
# Outside of any tmux session (e.g., VS Code terminal)
tmux display-message -p '#S'
# Returns: specialist-test-agent (or another active session)Solution
Check if we are actually INSIDE a tmux session before using tmux display-message. The $TMUX environment variable is only set when inside a tmux session.
Fix in heartbeat-hook:
# Get agent ID from env (set by pan work issue) or tmux session name
if [ -n "$PANOPTICON_AGENT_ID" ]; then
AGENT_ID="$PANOPTICON_AGENT_ID"
elif [ -n "$TMUX" ]; then
# Only use tmux session name if we are actually inside tmux
AGENT_ID=$(tmux display-message -p '#S' 2>/dev/null)
else
# Not in tmux, use a distinct identifier for the main CLI
AGENT_ID="main-cli"
fi
AGENT_ID="${AGENT_ID:-unknown}"Impact
- Specialist agent status incorrectly shows "active" when idle
- Dashboard spinner misleads users about agent activity
- Could mask actual agent issues if users dismiss the spinner as a false positive
Files to Modify
src/templates/hooks/heartbeat-hook(source template)- Users will need to re-run
pan syncto update their installed hook