fix(process_registry): poll() must not mark completion as consumed (#10156) - #26616
Closed
someaka wants to merge 1 commit into
Closed
fix(process_registry): poll() must not mark completion as consumed (#10156)#26616someaka wants to merge 1 commit into
someaka wants to merge 1 commit into
Conversation
PR NousResearch#8228 added _completion_consumed tracking to suppress duplicate completion notifications. The fix correctly applied to wait() and read_log() (both are agent-facing read operations that consume the result), but incorrectly extended to poll(), which is a read-only status query. When poll() marks _completion_consumed, the gateway watcher breaks after the consumed check and never retries, permanently suppressing the notify_on_complete notification. Remove the _completion_consumed.add(session_id) call from poll(). Only wait() and read_log() should mark consumed. Fixes NousResearch#10156
Collaborator
Author
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.
Problem
poll()inprocess_registry.pycalls_completion_consumed.add(session_id)when the queried process has already exited. This marks the completion as consumed, which causes the gateway watcher (andnotify_on_completedrain loops in the CLI and TUI) to suppress the completion notification — they checkis_completion_consumed()and skip it.poll()is a read-only status query, analogous to checking whether a letter has arrived without opening the envelope. It should never suppress the eventual delivery notification.Root cause
PR #8228 introduced
_completion_consumedtracking to suppress duplicate completion notifications when the agent has already seen the output viawait()orread_log(). The fix correctly applied towait()andread_log()(both are agent-facing read operations that consume the result), but incorrectly also added the mark topoll().Fix
Remove the single line
self._completion_consumed.add(session_id)frompoll(). Onlywait()andread_log()mark completions as consumed.Tests
test_poll_does_not_mark_completion_consumed— renamed fromtest_poll_marks_completion_consumed, assertion flipped toassert nottest_poll_then_wait_marks_consumed— new: poll() followed by wait() — poll() must not consume, wait() must still consumetest_poll_then_read_log_marks_consumed— new: poll() followed by read_log() — poll() must not consume, read_log() must still consumetest_wait_marks_completion_consumedandtest_log_marks_completion_consumedunchangedFixes #10156