You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python: Include reasoning messages in MESSAGES_SNAPSHOT events (microsoft#4844)
* Include reasoning messages in MESSAGES_SNAPSHOT (microsoft#4843)
FlowState now tracks reasoning messages emitted during a run.
_emit_text_reasoning() persists reasoning (including encrypted_value)
into flow.reasoning_messages, and _build_messages_snapshot() appends
them to the final MESSAGES_SNAPSHOT event.
Changes:
- Add reasoning_messages field to FlowState
- Update _emit_text_reasoning() to accept optional flow parameter
- Include reasoning_messages in _build_messages_snapshot()
- Add 'reasoning' to ALLOWED_AGUI_ROLES so normalize_agui_role()
preserves the role through snapshot round-trips
- Skip reasoning messages in agui_messages_to_agent_framework() since
they are UI-only state and should not be forwarded to LLM providers
- Add regression tests for snapshot emission, encrypted value
preservation, and multi-turn round-trip with reasoning
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Python: Include reasoning messages in MESSAGES_SNAPSHOT events
Fixesmicrosoft#4843
* Fix PR review feedback for reasoning persistence (microsoft#4843)
- Accumulate reasoning text per message_id (append deltas) instead of
storing only the current chunk, matching flow.accumulated_text pattern
- Use camelCase encryptedValue in snapshot JSON to match AG-UI protocol
conventions (toolCallId, encryptedValue)
- Normalize snake_case encrypted_value to encryptedValue in
agui_messages_to_snapshot_format for input compatibility
- Update normalize_agui_role docstring to include reasoning role
- Add tests for incremental reasoning accumulation and key normalization
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review feedback for microsoft#4843: Python: agent-framework-ag-ui: include reasoning messages in MESSAGES_SNAPSHOT
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments