microsoft / microsoft/agent-framework

.NET: [Feature]: Consider passing AgentRunOptions to the underlying agents in WorkflowHostAgent.

Open
#3,679 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

.NET
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

Description

When mapping a workflow as an agent with AsAgent(), the underlying workflow ignores the agentrunoptions.

https://github.com/microsoft/agent-framework/blob/6255abd687d8271d9f125027d420a55e3c8f29cc/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostAgent.cs#L123-L139

Currently the AgentRunOptions are not passed to the underlying agents when the WorkflowHostAgent calls them. This means that any options set in AgentRunOptions or any other information that might be included (for example, if they are ChatClientAgentOptions with a ChatOptions and custom AdditionalProperties) can't be accessed.

Ideally the options would flow through InvokeStageAsync https://github.com/microsoft/agent-framework/blob/main/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowSession.cs#L153 and will be included in the TurnToken https://github.com/microsoft/agent-framework/blob/main/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowSession.cs#L167 so that they can be accessed by the underlying agents.

Code Sample

Language/SDK

.NET

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with WorkflowHostAgent.cs at lines 123-139, then trace InvokeStageAsync in WorkflowSession.cs around line 153 and TurnToken around line 167. Follow how AgentRunOptions currently move through the workflow and identify the existing access point for underlying agents. Done means options, including additional information such as ChatOptions and custom properties, are available to those agents.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.