feat(watchdog): detect polecat sessions stuck at idle prompt#3297
Closed
quad341 wants to merge 1 commit intogastownhall:mainfrom
Closed
feat(watchdog): detect polecat sessions stuck at idle prompt#3297quad341 wants to merge 1 commit intogastownhall:mainfrom
quad341 wants to merge 1 commit intogastownhall:mainfrom
Conversation
Adds a two-phase idle-prompt watchdog to the witness patrol. When a polecat
has hooked work but is sitting at the Claude Code ❯ idle prompt, the witness
now:
1. Records the first-seen-idle timestamp in witness/idle-prompt-state.json
2. After IdlePromptGrace (default 2m), nudges the polecat to run `gt done`
3. After IdlePromptThreshold (default 15m) from the nudge, classifies the
session as ZombieAtIdlePrompt and surfaces it via patrol scan --notify
Detection uses the existing tmux.IsIdle() which checks for:
- Absence of "esc to interrupt" status bar indicator (rules out active work
and all thinking states: Pondering, Whisking, Cogitated, etc.)
- Presence of the ❯ ready-prompt prefix
New ZombieClassification values:
- at-idle-prompt-nudged: first detection, nudge sent
- at-idle-prompt: confirmed stuck after threshold, for mayor notification
Both classify as ImpliesActiveWork=true so patrol --notify picks them up.
Thresholds are configurable via operational.witness in settings/config.json:
idle_prompt_grace (default "2m"), idle_prompt_threshold (default "15m")
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
❌ 13 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Collaborator
|
Closing ahead of v1.0.0 — Gas Town is transitioning to Gas City. If still relevant, please re-file against the new project. |
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.
Summary
idle_prompt.go: Detects polecat tmux sessions stuck at Claude Code idle promptTest plan
go test ./internal/witness/...passes🤖 Generated with Claude Code