Repository navigation
Python: Read orchestration outputs as agent responses in tool approval samples - #10084
Draft
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
Draft
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
Conversation
…l samples Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Naveen Chatlapalli (1aifanatic)
temporarily deployed
to
github-app-auth
November 4, 2026 05:42 — with
GitHub Actions
Inactive
Naveen Chatlapalli (1aifanatic)
temporarily deployed
to
github-app-auth
November 4, 2026 05:42 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the workflow sample response-handling updates.
No open issues 🎉
What changed in this PR
Updates four Python workflow samples to consume the response types emitted by orchestration builders, fixing crashes caused by treating outputs as message lists.
Changes:
- Sequential and group chat approval samples combine streamed
AgentResponseUpdatevalues and print messages containing text. - Concurrent samples read messages from
AgentResponse.messages. - Imports and output comments are updated to match the corrected handling.
| File | Description |
|---|---|
python/samples/03-workflows/tool-approval/sequential_builder_tool_approval.py |
Builds the summary from the final participant’s streamed response. |
python/samples/03-workflows/tool-approval/group_chat_builder_tool_approval.py |
Combines streamed response updates and skips messages without text. |
python/samples/03-workflows/tool-approval/concurrent_builder_tool_approval.py |
Validates AgentResponse output and reads its messages. |
python/samples/03-workflows/orchestrations/concurrent_custom_agent_executors.py |
Reads aggregated messages from the workflow’s AgentResponse. |
Review effort: Balanced
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
Four orchestration samples treat workflow
outputevents as alist[Message]. Sequential, group chat and concurrent orchestrations emitAgentResponseUpdatevalues while streaming and anAgentResponseotherwise, so each sample crashes when the output arrives. In the three tool-approval samples that happens after the approval has already gone through:maintool-approval/sequential_builder_tool_approval.pyTypeError: 'AgentResponseUpdate' object is not iterabletool-approval/group_chat_builder_tool_approval.pyTypeError: 'AgentResponseUpdate' object is not iterabletool-approval/concurrent_builder_tool_approval.pyTypeError: 'AgentResponse' object is not iterable(after the "not a list of Message" check is skipped by itsand)orchestrations/concurrent_custom_agent_executors.pyTypeError: 'AgentResponse' object is not iterableDescription & Review Guide
AgentResponseUpdateoutputs and print the summary fromAgentResponse.from_updates(...), skipping messages with no text, such as the tool call..messagesfrom theAgentResponse, asconcurrent_agents.pyalready does.Verification: I replaced the Foundry client with a scripted stub that first calls the approval-required tool and answers once the result comes back. Each sample then goes through the approval request, the simulated approval and the final summary, for example
Workflow summary: [DatabaseAgent]: Stub final answer.The unmodified files crash with the errors above under the same stub. Ruff and the repo'spyrightconfig.samples.json(with--warnings) are clean.Related Issue
N/A - trivial change: samples are updated to the output types the orchestrations already emit.
AI Assistance
AI assistance details: Claude Code helped find the crashes by running the samples against a stub client, update the output handling, re-run the approval flow, and draft this description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.🤖 Generated with Claude Code