fix: remove _completion_consumed marking from poll() to prevent watcher suppression - #10190
Closed
nightq wants to merge 1 commit into
Closed
fix: remove _completion_consumed marking from poll() to prevent watcher suppression#10190nightq wants to merge 1 commit into
nightq wants to merge 1 commit into
Conversation
…er suppression Fixes NousResearch#10156 Root cause: poll() marked sessions as completion-consumed when exited, but poll() is a read-only status query. This caused the gateway's _run_process_watcher to skip notifications because it checked is_completion_consumed() before delivering. A race between user messages triggering poll() and the watcher's 5s cycle permanently lost notifications. Fix: Remove _completion_consumed.add() from poll(). Only wait() and log() mark consumed, since they represent actual consumption of output. Also updated test to match new behavior.
Author
|
Closing stale PR from previous run. Will recreate if the fix is still needed. |
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
Fixes a regression where notify_on_complete notifications were silently suppressed when the agent called process(action='poll') on an exited background process.
Root Cause
PR #8228 added _completion_consumed tracking to suppress duplicate notifications. However, it incorrectly extended the same semantics to poll() — a read-only status query. When poll() saw an exited process, it marked the session as consumed, causing the gateway's _run_process_watcher to skip the notification entirely (with a permanent break, no retry).
Fix
Removed _completion_consumed.add(session_id) from poll(). Only wait() and log() mark consumed, since they represent actual consumption of output. Updated the corresponding test to match new behavior.
Test Plan
Closes #10156