fix(interactive): report pending user/system messages as metadata (#124) - #146
Open
Shailendra005 wants to merge 1 commit into
Open
fix(interactive): report pending user/system messages as metadata (#124)#146Shailendra005 wants to merge 1 commit into
Shailendra005 wants to merge 1 commit into
Conversation
The per-turn queue status block previewed the text of pending user/system messages, which the dispatcher then delivered again through its notification, so the agent answered the same message twice. Add a preview_content flag on Channel (threaded through QueueManager.queue) and set it False for the message-input channels, so their status shows only the pending count. Producer channels keep content previews. Fixes NVIDIA-NeMo#124 Signed-off-by: Shailendra005 <shivzala06@outlook.com>
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.
Motivation
Fixes #124. In the TUI, a submitted user message is answered twice.
The per-turn
queuescontext block (interactive.py,self.context["queues"] = Context(expr="self.queue_manager.status()")) renders a short preview of each pending item, including the text of pendinguser_messages. That message is then delivered to the agent again through the dispatcher'snotification(handle(...)), so the agent sees the same content on two paths and responds to it twice.What changed
Channel.__init__gains apreview_content: bool = Trueflag, threaded throughQueueManager.queue(...). WhenFalse,Channel.status()reports only the pending count ("<name>: N pending (awaiting delivery)") and never the item content.InteractiveAgentcreates itsuser_messagesandsystem_messageschannels withpreview_content=False, since those items are delivered through the dispatcher. Producer channels (e.g.job_outputs) are unchanged and still show content previews.No dispatcher change; behavior is preserved for every other channel.
Tests
Added to
src/nooa/runtime/tests/test_channels.py:QueueManager.queue(),test_channels.pypasses (42), the broaderruntime/tests/suite passes (174 passed, 1 skipped), andruff check/ruff format --checkare clean.