Skip to content

fix(gateway): suppress the duplicate clarify tool-progress bubble (#69175) - #69212

Closed
PRATHAMESH75 wants to merge 1 commit into
NousResearch:mainfrom
PRATHAMESH75:fix/clarify-suppress-duplicate-progress-bubble
Closed

fix(gateway): suppress the duplicate clarify tool-progress bubble (#69175)#69212
PRATHAMESH75 wants to merge 1 commit into
NousResearch:mainfrom
PRATHAMESH75:fix/clarify-suppress-duplicate-progress-bubble

Conversation

@PRATHAMESH75

Copy link
Copy Markdown
Contributor

Summary

When tool progress is enabled, a clarify call renders two near-identical messages in chat:

  1. The generic tool-progress bubble — ❓ Asking <question> — built from get_tool_verb("clarify")"Asking" in progress_callback.
  2. The full clarify prompt sent by the tool's own callback (send_clarify, scheduled from _clarify_callback_sync in gateway/run.py).

The bubble is a verbatim duplicate of the prompt, so the user sees the same clarify question twice (#69175).

Fix

clarify already owns its chat rendering via the adapter's send_clarify callback, so its generic progress bubble is always redundant. This PR:

  • adds agent.display.tool_renders_own_progress() — a small predicate mirroring the existing verb_drops_preview() idiom — backed by a _TOOL_SELF_RENDERED_PROGRESS frozenset marking tools that deliver their own complete prompt via a dedicated adapter callback;
  • gates progress_callback in gateway/run.py on it, right after the tool.started filter, so the duplicate bubble is skipped.

Scope is deliberately narrow:

  • the ephemeral live status line (Slack setStatus) and log-mode stdout logging are unaffected — they run before this gate;
  • the clarify verb mapping ("Asking") is left intact, so nothing else that reads the verb changes.

Tests

  • tests/agent/test_display.py::TestToolRendersOwnProgress — the predicate is True for clarify, False for regular tools, and the verb mapping stays defined.
  • Ran tests/agent/test_display.py plus the gateway clarify suites (test_clarify_active_session_bypass, test_telegram_clarify_buttons, test_discord_clarify_buttons) — 106 passed, no regressions.

Fixes #69175

…usResearch#69175)

When tool progress is enabled, a clarify call emitted two near-identical
messages: the generic tool-progress bubble ("❓ Asking <question>") built
from get_tool_verb("clarify") -> "Asking", and then the full prompt sent
by the clarify tool's own callback (send_clarify, via
_clarify_callback_sync in gateway/run.py). The bubble was a verbatim
duplicate of the prompt.

Add agent.display.tool_renders_own_progress(), mirroring the existing
verb_drops_preview() predicate, to mark tools that deliver their own
complete prompt via a dedicated adapter callback, and skip the generic
tool-progress bubble for them in progress_callback. The ephemeral status
line and log-mode logging are unaffected; the clarify verb mapping is
left intact.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Jul 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: #54328 already includes the clarify progress-bubble suppression alongside a separate prose-before-poll ordering repair. This is a focused alternative; maintainers can choose the preferred scope.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the sharp diagnosis @PRATHAMESH75 — you found the exact root cause (the generic tool-progress bubble duplicating send_clarify's own rendering) independently, same day it was fixed.

This landed hours earlier via #69318 (merged): the gateway now skips the tool-progress bubble for clarify entirely, since the prompt rendering IS the progress. Closing as superseded.

Appreciate both your Slack PRs today — the block-text one (#68160) was also superseded only because a broader consolidated fix covered it. Keep them coming.

@teknium1 teknium1 closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clarify tool 触发时 tool progress 与 send_clarify 重复发送同一条消息

3 participants