Files
agent-framework/python/packages
T
Evan Mattson 2f2495e196 Python: Fix function_approval_response extraction in AG-UI workflow path (#4550)
* Extract function_approval_response from workflow messages (#4546)

_extract_responses_from_messages now handles function_approval_response
content in addition to function_result content. Previously, approval
responses sent via the messages field were silently dropped because the
function only checked for content.type == "function_result".

The approval response is keyed by content.id and includes the approved
status, id, and serialized function_call — consistent with how
_coerce_content identifies approval response payloads.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Apply pre-commit auto-fixes

* Fix #4546: Update docstring and add integration tests for message-based approvals

- Update _extract_responses_from_messages docstring to reflect that it
  now handles function_approval_response content in addition to
  function_result content.
- Add integration tests for run_workflow_stream across two turns with
  approval responses provided via messages (function_approvals) rather
  than resume.interrupts, covering both approved and denied scenarios.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review feedback for #4546

- Use safer 'not .get("interrupt")' assertion instead of 'not in'
  to handle Pydantic v2 model_dump() including keys with None values
- Add unit test for mixed function_result and function_approval_response
  in the same message to TestExtractResponsesFromMessages

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2f2495e196 · 2026-03-11 22:54:16 +00:00
History
..
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00
2026-03-11 18:53:38 +00:00