Skip to content

fix(process_registry): poll() must not mark completion as consumed (#10156) - #26616

Closed
someaka wants to merge 1 commit into
NousResearch:mainfrom
someaka:pr-fix-poll-completion
Closed

fix(process_registry): poll() must not mark completion as consumed (#10156)#26616
someaka wants to merge 1 commit into
NousResearch:mainfrom
someaka:pr-fix-poll-completion

Conversation

@someaka

@someaka someaka commented May 15, 2026

Copy link
Copy Markdown

Problem

poll() in process_registry.py calls _completion_consumed.add(session_id) when the queried process has already exited. This marks the completion as consumed, which causes the gateway watcher (and notify_on_complete drain loops in the CLI and TUI) to suppress the completion notification — they check is_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_consumed tracking to suppress duplicate completion notifications when the agent has already seen the output via wait() or read_log(). The fix correctly applied to wait() and read_log() (both are agent-facing read operations that consume the result), but incorrectly also added the mark to poll().

Fix

Remove the single line self._completion_consumed.add(session_id) from poll(). Only wait() and read_log() mark completions as consumed.

Tests

  • test_poll_does_not_mark_completion_consumed — renamed from test_poll_marks_completion_consumed, assertion flipped to assert not
  • test_poll_then_wait_marks_consumed — new: poll() followed by wait() — poll() must not consume, wait() must still consume
  • test_poll_then_read_log_marks_consumed — new: poll() followed by read_log() — poll() must not consume, read_log() must still consume
  • Existing test_wait_marks_completion_consumed and test_log_marks_completion_consumed unchanged

Fixes #10156

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
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tools Tool registry, model_tools, toolsets duplicate This issue or pull request already exists labels May 15, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #10158 (and #21903). All three fix the same poll() marking _completion_consumed regression from #8228 — making poll() read-only so notify_on_complete watcher is not suppressed. Fixes #10156.

@someaka

someaka commented May 15, 2026

Copy link
Copy Markdown
Author

Closing as duplicate — #10158 and #21903 already address the same regression with the same fix (making poll() read-only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: poll() marking _completion_consumed silently suppresses watcher notification

2 participants