Repository navigation
Python: Include InvokeAzureAgent input.arguments in agent text - #7907
Shivani . (Shivani767) wants to merge 1 commit into
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.
There was a problem hiding this comment.
Pull request overview
Fixes #7902 by preserving evaluated InvokeAzureAgent arguments in agent input text.
Changes:
- Formats arguments as
key: valuelines. - Combines arguments with explicit or fallback message text.
- Adds regression coverage for argument-only, combined, and expression-based inputs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| 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.
|
/review |
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): 88e4989182d7
Model: gpt-5.6-sol
Overview
The change correctly recovers previously discarded input.arguments, evaluates expressions before formatting, and preserves the existing messages-only behavior when the argument map is empty. The new tests cover arguments alone on a clean state, arguments with explicit messages, and expression-valued arguments. However, arguments-only actions still execute the implicit-input fallback chain, so chained workflows append a prior agent response or workflow input to the explicit argument block.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/declarative/agent_framework_declarative/_workflows/_executors_agents.py
| messages_text = str(getattr(last, "text", "")) # type: ignore | ||
| elif evaluated_input: | ||
| messages_text = str(cast(Any, evaluated_input)) | ||
| else: |
There was a problem hiding this comment.
When an action supplies input.arguments but omits input.messages, this branch still reads the implicit fallback chain and line 741 appends it to the argument block. In a chained workflow, every completed agent sets System.LastMessage, so arguments-only actions such as the customer-support TicketingAgent receive both their structured fields and the prior agent's response; first-agent actions can similarly duplicate values from Workflow.Inputs. Please skip the implicit fallback when explicit arguments are present, while retaining it for actions with neither arguments nor messages.
|
Please re-open when PR comments are resolved / responded to. |
…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.
|
Evan Mattson (@moonbox3) Review feedback addressed — requesting re-open please. Change in latest commit (1fd2f7e): the implicit fallback chain (Local.input / System.LastMessage / Workflow.Inputs) is now skipped when explicit New regression test: |
Evan Mattson (@moonbox3) Review feedback addressed — requesting re-open please. Change in latest commit (1fd2f7e): the implicit fallback chain (Local.input / System.LastMessage / Workflow.Inputs) is now skipped when explicit input.arguments are present (elif not evaluated_args:), while retained for actions with neither arguments nor messages. This prevents arguments-only actions like the customer-support TicketingAgent from getting the prior agent's response or Workflow.Inputs appended to their structured fields in chained workflows. New regression test: test_agent_executor_build_input_text_arguments_only_skips_implicit_fallback poisons all three fallback sources and asserts the output is exactly "IssueDescription: Printer jammed". Existing tests (arguments-only, arguments+messages, expression-valued arguments, fallback-chain, last-message fallback) all pass: 4 passed, 5 skipped (powerfx). |
…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.
…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.
|
Review feedback addressed — branch rebased onto current Rebase. The branch is now
Feedback addressed ( The fallback is now gated on Regression test added: Validation (rebased head): One practical note: the fork has no write access upstream, so I cannot re-open this PR through the API ( |
|
Closed in favour of a fresh, non-draft PR: #8547 — #8547 Why a new PR rather than a re-open: the What #8547 contains relative to this PR:
Evan Mattson (@moonbox3) — the feedback you asked to have resolved before re-opening is in #8547. Please review there, and close this PR out in favour of it. |
…soft#7902) (microsoft#8547) * Python: Include InvokeAzureAgent input.arguments in agent text Fold evaluated input.arguments into the text passed to agent.run() so argument-only InvokeAzureAgent actions no longer silently invoke with an empty string. * Python: skip implicit fallback when InvokeAzureAgent arguments are present 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.
Motivation & Context
InvokeAzureAgentExecutor._build_input_text()evaluatedinput.argumentsintoevaluated_argsand then never used that dict. Actions that supply onlyinput.arguments(as in the customer_support sample) therefore invoked the agent with an empty string.Fixes #7902
Description & Review Guide
What are the major changes?
input.argumentsaskey: valuelines (same shape as multi-valueWorkflow.Inputsfallback).What is the impact of these changes?
InvokeAzureAgentactions now pass structured values toagent.run().What do you want reviewers to focus on?
structured_inputschannel (.NETuses the latter; Pythonrun()has no equivalent parameter).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.