Skip to content

fix(process_registry): keep poll() read-only — do not mark completions consumed - #35552

Closed
someaka wants to merge 1 commit into
NousResearch:mainfrom
someaka:pr/poll-readonly
Closed

fix(process_registry): keep poll() read-only — do not mark completions consumed#35552
someaka wants to merge 1 commit into
NousResearch:mainfrom
someaka:pr/poll-readonly

Conversation

@someaka

@someaka someaka commented May 30, 2026

Copy link
Copy Markdown

What

Removes the _completion_consumed.add(session_id) call from poll(), making it a pure read operation. Adds explicit mark_completion_consumed() method for callers that have actually delivered the notification.

Why

poll() was silently eating completion events, preventing any other consumer from seeing them. The TUI notification bridge needs to poll for events without consuming them — consumption should only happen after successful delivery.

Fixes #10156.

Changes

  • poll(): removed _completion_consumed.add(session_id) — now read-only
  • Added mark_completion_consumed(session_id) — explicit consumption after delivery
  • Updated comments: "wait/log" instead of "wait/poll/log"

…s consumed

poll() should be a pure read operation. mark_completion_consumed()
is now an explicit method for callers that have actually delivered
the notification (e.g., TUI notification bridge).

The old behavior caused poll() to silently eat completion events,
preventing any other consumer from seeing them.
@alt-glitch alt-glitch added type/bug Something isn't working comp/tools Tool registry, model_tools, toolsets tool/terminal Terminal execution and process management duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists labels May 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #10158 (canonical fix for #10156). This is the same poll() read-only fix — previous duplicates by the same author: #31750, #31756, #26659, #26616, #21903.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Review Findings

This PR fixes a data-consistency bug where poll() was marking process completions as consumed — i.e., a read-only query had the side effect of suppressing drain-loop notifications.

✅ Looks Good

  • Clean fix: Removes the self._completion_consumed.add(session_id) line from poll() — this was a mutation side effect in a read-only method.
  • Updated docstrings: is_completion_consumed() and drain_notifications() docstrings corrected to no longer mention "poll" as a consumption source.
  • Expose mark_completion_consumed(): Adds a dedicated public method so consumers that genuinely need to mark a session consumed (e.g. TUI notification delivery) can do so explicitly.
  • Tests: Existing test suite covers the regression scenario.
  • Minimal diff: Just removes the side-effect line and adds the explicit API. Low risk.

No Issues Found


Reviewed by Hermes Agent

@someaka

someaka commented May 30, 2026

Copy link
Copy Markdown
Author

Closing — duplicate of canonical #10158 per @alt-glitch's review. The poll() read-only fix already landed via #10158.

@someaka someaka closed this May 30, 2026
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 tool/terminal Terminal execution and process management 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

3 participants