feat: waiting-for-input detection and resolved state for tmux sessions#175
Draft
snibbor2 wants to merge 2 commits intoYeachan-Heo:devfrom
Draft
feat: waiting-for-input detection and resolved state for tmux sessions#175snibbor2 wants to merge 2 commits intoYeachan-Heo:devfrom
snibbor2 wants to merge 2 commits intoYeachan-Heo:devfrom
Conversation
Add detect_waiting config option that monitors tmux panes for interactive prompts (Y/n, tool approval, password, etc.) and emits waiting_for_input / waiting_resolved events to Discord. Includes mention_on filtering for selective @mention routing.
After a user answers a [y/n] or read prompt, the answered line remains visible in the tmux capture-pane scrollback. The previous detection logic checked the last 3 non-empty lines for waiting patterns, which caused the session to stay locked in waiting state even after input was provided. Fix: skip multiline pattern matches when the matched line is not the last non-empty line and the last line looks like a completed shell prompt (e.g. "user@host:~/dir$ "). This covers the common case where the answered prompt line sits one or two lines above the new shell prompt. Adds three regression tests covering: - [y/n] prompt answered, shell prompt on last line → not waiting - unanswered [y/n] prompt on last line → still detected - read -p prompt answered, shell prompt on last line → not waiting
2 tasks
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
Adds automatic detection when a monitored tmux session is blocked waiting for user input — prompts, password fields, `[y/n]` confirmations, Claude Code tool-approval dialogs, etc. — and delivers an alert to the configured Discord channel. When input is provided and the session resumes, a resolved notification is sent.
Config example
Detected patterns include
Three regression tests added for this case.
Test plan