Skip to content

Hide memory tool progress from public gateway streams#23506

Open
taivu1998 wants to merge 1 commit into
NousResearch:mainfrom
taivu1998:tdv/issue-6316-memory-progress-privacy
Open

Hide memory tool progress from public gateway streams#23506
taivu1998 wants to merge 1 commit into
NousResearch:mainfrom
taivu1998:tdv/issue-6316-memory-progress-privacy

Conversation

@taivu1998

Copy link
Copy Markdown

Summary

Fixes #6316 by keeping built-in memory tool lifecycle previews out of public gateway progress surfaces while preserving normal tool execution and private model-visible tool results.

Root Cause

The memory tool already generated concise previews such as +memory, ~memory, and -memory. Those previews are useful internally, but gateway progress renderers treated them like ordinary tool progress and forwarded them to public-facing chat surfaces, including Telegram and API streaming clients.

Changes

  • Add a shared should_hide_public_tool_progress() policy in agent.display.
  • Suppress memory progress before Telegram/gateway progress messages are rendered, including verbose argument rendering and long-tool onboarding hints.
  • Suppress memory lifecycle events in OpenAI-compatible chat-completions SSE progress.
  • Apply the same privacy rule to Responses API function-call streaming and /v1/runs structured progress events.
  • Add regression tests covering Telegram all/verbose modes, memory completion-only hints, chat SSE, Responses SSE, and run progress callbacks.

Validation

  • uv run --extra dev --extra messaging pytest tests/agent/test_display.py tests/gateway/test_memory_tool_progress_privacy.py tests/gateway/test_api_server.py::TestChatCompletionsEndpoint::test_stream_tool_progress_skips_memory_events tests/gateway/test_api_server.py::TestResponsesStreaming::test_stream_function_call_items_skip_memory_tool tests/gateway/test_api_server.py::TestRunStructuredEvents::test_run_event_callback_skips_memory_tool_progress -q
  • uv run --extra dev ruff check agent/display.py gateway/run.py gateway/platforms/api_server.py tests/agent/test_display.py tests/gateway/test_api_server.py tests/gateway/test_memory_tool_progress_privacy.py
  • git diff --check HEAD

@taivu1998 taivu1998 marked this pull request as ready for review May 11, 2026 03:46
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery tool/memory Memory tool and memory providers labels May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: memory tool response leaks into Telegram output

2 participants