Add notification message storage and waiting session timeout handling#20
Merged
Add notification message storage and waiting session timeout handling#20
Conversation
- Store notification message in task_description so operators can see what Claude is waiting for - Give waiting sessions a longer stale timeout (10 min vs 5 min) so they stay visible longer before being marked stale - Log a warning when a waiting session finally times out - Add 13 new tests covering: notification message storage, empty/missing message edge cases, auto-session creation, broadcast verification, full status lifecycle transitions, rapid notifications, race conditions, and waiting-specific stale checker behavior https://claude.ai/code/session_01KdGbmDksNwHqRcCj2TvdAy
Unit Test Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
This PR enhances the notification event handling and adds special timeout logic for sessions in the "waiting" state. Notification messages are now stored in
task_description, and waiting sessions receive a longer stale timeout (10 minutes instead of 5 minutes) with prominent logging.Key Changes
Notification message storage: When a
Notificationevent is received with a non-emptymessagefield, it is now stored in the session'stask_description. Empty or missing messages do not overwrite existing descriptions.Waiting session timeout handling: Sessions in "waiting" status now use a 10-minute stale timeout instead of the standard 5-minute timeout, allowing more time for operator approval. Non-waiting sessions continue to use the 5-minute threshold.
Enhanced logging: When a waiting session times out, a warning is logged with the session ID and elapsed time to help operators identify sessions that have been pending approval for too long.
Comprehensive test coverage: Added 15 new tests covering:
Implementation Details
messagefield before updatingtask_description, preventing accidental overwrites.https://claude.ai/code/session_01KdGbmDksNwHqRcCj2TvdAy