Repository navigation
Python: Include InvokeAzureAgent input.arguments in agent text (#7902) - #8547
Merged
Evan Mattson (moonbox3) merged 2 commits intoSep 21, 2026
Conversation
Fold evaluated input.arguments into the text passed to agent.run() so argument-only InvokeAzureAgent actions no longer silently invoke with an empty string.
…esent Addresses review on microsoft#7907: arguments-only actions no longer append System.LastMessage / Workflow.Inputs fallback text to their structured fields in chained workflows. Adds a regression test with poisoned fallback state.
Shivani . (Shivani767)
temporarily deployed
to
github-app-auth
September 19, 2026 16:55 — with
GitHub Actions
Inactive
Shivani . (Shivani767)
temporarily deployed
to
github-app-auth
September 19, 2026 16:55 — with
GitHub Actions
Inactive
Shivani . (Shivani767)
temporarily deployed
to
github-app-auth
September 19, 2026 16:55 — with
GitHub Actions
Inactive
Shivani . (Shivani767)
temporarily deployed
to
github-app-auth
September 19, 2026 16:55 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation addresses the reported data loss while preserving and testing existing fallback behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes Python declarative InvokeAzureAgent actions silently dropping input.arguments.
Changes:
- Formats evaluated arguments as
key: valueinput text. - Prevents implicit fallback text from contaminating arguments-only invocations.
- Adds regression coverage for arguments, messages, expressions, and fallback behavior.
| File | Description |
|---|---|
python/packages/declarative/agent_framework_declarative/_workflows/_executors_agents.py |
Includes evaluated arguments in agent input text. |
python/packages/declarative/tests/test_graph_coverage.py |
Adds regression tests for argument handling. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
5 tasks done
Evan Mattson (moonbox3)
approved these changes
Sep 21, 2026
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
InvokeAzureAgentaccepts aninput.argumentsmap, but the Python declarative executor never sent it to the agent._build_input_textevaluated the arguments and then discarded them, so an arguments-only action invoked the agent with an empty string —input.argumentswas silently dropped (#7902).This is the successor to #7907, which was closed by Evan Mattson (@moonbox3) with "Please re-open when PR comments are resolved / responded to." Both pieces of feedback (the automated review finding and the addressed fallback behaviour below) are now in, so this PR carries the same change as a fresh, non-draft PR. This supersedes #7907 — please close #7907 in favour of this one.
Description & Review Guide
What are the major changes?
_build_input_textnow folds evaluatedinput.argumentsinto the text passed toagent.run(), formatted askey: valuelines (the same shape the multi-valueWorkflow.Inputsfallback already used). Python's agentrun()has no separate structured-input channel, so arguments must be folded into this text rather than discarded.Local.input/Local.userInput→System.LastMessage.Text→Workflow.Inputs) is now gated onelif not evaluated_args:— it is skipped when explicitinput.argumentsare present, and retained for actions with neither arguments nor messages.What is the impact of these changes?
input.arguments, never sends them to the agent #7902).TicketingAgentno longer receives the previous agent's response appended to its structured fields. Every completed agent setsSystem.LastMessage, so before this change both the structured fields and the prior agent's text reached the agent; first-agent actions could similarly duplicateWorkflow.Inputs.What do you want reviewers to focus on?
key: valuefolding format as the substitute for a structured-input channel — it is a text convention, not a typed one.input.argumentsis non-empty is the right default (it is what the automated review asked for).Related Issue
Fixes #7902
Supersedes #7907 (closed — "re-open when PR comments are resolved"). No other open PR addresses #7902.
Review follow-up from #7907
Addressed in
4915e69c5: when an action suppliesinput.argumentsbut omitsinput.messages, the fallback chain was still read and appended to the argument block. Now skipped viaelif not evaluated_args:.New regression test:
test_agent_executor_build_input_text_arguments_only_skips_implicit_fallbackpoisons all three fallback sources and asserts none of them reach the argument block.Validation
Branch rebased onto current
main(723256961, 2026-09-18); no conflicts.mainstill discardsinput.argumentsat_executors_agents.py:718, so #7902 remains reproducible on currentmain.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./cc Evan Mattson (@moonbox3) — the #7907 feedback is addressed; re-opening was not available from this account (no write access upstream, and the PR is a draft), so this fresh PR carries the same change.