Skip to content

Conversation

@moonbox3
Copy link
Contributor

@moonbox3 moonbox3 commented Feb 11, 2026

Motivation and Context

  • Fix unconditional from powerfx import Engine import in _declarative_base.py that makes the entire agent_framework_declarative package unusable without .NET installed.
    Wraps the import in try/except (ImportError, RuntimeError) matching the existing pattern in _models.py and _state.py.
  • Fix _create_agent_with_provider passing response_format as a direct keyword argument to provider.create_agent(), which fails on providers with strict signatures (e.g.
    AzureAIProjectAgentProvider). Moves response_format into default_options where all providers expect it.
  • Fix declarative workflows not forwarding kwargs from workflow.run() to agent tool invocations, which makes sure @tool functions receive custom context data (e.g., user tokens, service configs) passed by the caller.

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings February 11, 2026 01:36
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 11, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL16787211087% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
4017 225 💤 0 ❌ 0 🔥 1m 10s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes two Python declarative-agent creation failures: (1) importing agent_framework_declarative without a working .NET runtime due to an unconditional powerfx import, and (2) async provider-based agent creation failing on strict provider signatures due to passing response_format as an unexpected kwarg.

Changes:

  • Wrap from powerfx import Engine in _declarative_base.py with try/except (ImportError, RuntimeError) and gate evaluation when PowerFx isn’t available.
  • Pass structured output configuration via default_options={"response_format": ...} instead of a direct response_format= kwarg in provider-based agent creation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
python/packages/declarative/agent_framework_declarative/_workflows/_declarative_base.py Makes PowerFx import conditional and adds runtime handling when the engine is unavailable.
python/packages/declarative/agent_framework_declarative/_loader.py Fixes provider creation to avoid strict-signature kwarg errors by moving response_format into default_options.

@moonbox3 moonbox3 added the workflows Related to Workflows in agent-framework label Feb 11, 2026
@moonbox3 moonbox3 self-assigned this Feb 11, 2026
@moonbox3 moonbox3 requested a review from Copilot February 11, 2026 01:58
@moonbox3 moonbox3 moved this to In Review in Agent Framework Feb 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

@moonbox3 moonbox3 added this pull request to the merge queue Feb 11, 2026
Merged via the queue into microsoft:main with commit ff91473 Feb 11, 2026
25 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in Agent Framework Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python workflows Related to Workflows in agent-framework

Projects

Status: Done

4 participants