Skip to content

Python: feat(ag-ui): add emit_messages_snapshot config to suppress terminal snapshot - #7808

Open
Manideep Malyala (manideep-malyala) wants to merge 3 commits into
microsoft:mainfrom
manideep-malyala:fix-7807
Open

Python: feat(ag-ui): add emit_messages_snapshot config to suppress terminal snapshot#7808
Manideep Malyala (manideep-malyala) wants to merge 3 commits into
microsoft:mainfrom
manideep-malyala:fix-7807

Conversation

@manideep-malyala

Copy link
Copy Markdown

Fixes #7807

Summary

Adds a new emit_messages_snapshot flag (defaulting to True) to AgentConfig in the agent_framework_ag_ui package.

When set to False, the terminal MessagesSnapshotEvent is suppressed at the end of the run. This allows clients using HistoryProvider (or those managing their own state) to avoid full transcript rewrites on the client side, while maintaining full backward compatibility for existing applications.

Changes Made

  • Added emit_messages_snapshot boolean to AgentConfig
  • Updated run_agent_stream logic to check this config before yielding _build_messages_snapshot(flow, snapshot_messages)
  • Added a new test test_run_agent_stream_suppresses_messages_snapshot_if_configured in test_run.py to verify the suppression behavior.

Copilot AI balanced review requested due to automatic review settings August 21, 2026 16:57
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Aug 21, 2026
@github-actions github-actions Bot changed the title feat(ag-ui): add emit_messages_snapshot config to suppress terminal snapshot Python: feat(ag-ui): add emit_messages_snapshot config to suppress terminal snapshot Aug 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-out for terminal message snapshots while preserving existing behavior by default.

Changes:

  • Adds emit_messages_snapshot configuration.
  • Conditionally suppresses terminal snapshots.
  • Adds suppression coverage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
_agent.py Defines and propagates the configuration flag.
_agent_run.py Applies the flag before emitting the snapshot.
test_run.py Tests snapshot suppression and normal completion.
Suppressed comments (1)

python/packages/ag-ui/tests/ag_ui/test_run.py:1853

  • Remove the trailing spaces on this blank line; Ruff formatting will reject whitespace-only blank lines.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

}

events = [event async for event in agent.run(payload)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Python AG-UI: terminal MessagesSnapshotEvent always rewrites full transcript; prefer incremental-only option

2 participants