Skip to content

fix(interactive): report pending user/system messages as metadata (#124) - #146

Open
Shailendra005 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
Shailendra005:fix/tui-queue-preview-metadata-only
Open

fix(interactive): report pending user/system messages as metadata (#124)#146
Shailendra005 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
Shailendra005:fix/tui-queue-preview-metadata-only

Conversation

@Shailendra005

Copy link
Copy Markdown

Motivation

Fixes #124. In the TUI, a submitted user message is answered twice.

The per-turn queues context block (interactive.py, self.context["queues"] = Context(expr="self.queue_manager.status()")) renders a short preview of each pending item, including the text of pending user_messages. That message is then delivered to the agent again through the dispatcher's notification (handle(...)), so the agent sees the same content on two paths and responds to it twice.

What changed

  • Channel.__init__ gains a preview_content: bool = True flag, threaded through QueueManager.queue(...). When False, Channel.status() reports only the pending count ("<name>: N pending (awaiting delivery)") and never the item content.
  • InteractiveAgent creates its user_messages and system_messages channels with preview_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:

  • metadata-only status hides a single message's content,
  • hides every item and the numbered preview lines,
  • the flag threads through QueueManager.queue(),
  • regression: default channels still preview content.

test_channels.py passes (42), the broader runtime/tests/ suite passes (174 passed, 1 skipped), and ruff check / ruff format --check are clean.

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>
@furgalep furgalep self-assigned this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI user-message preview causes agents to answer twice

2 participants