Skip to content

Python: move Foundry eval serialization out of core - #8031

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 6 commits into
microsoft:mainfrom
eavanvalkenburg:foundry-eval-ownership
Sep 4, 2026
Merged

Python: move Foundry eval serialization out of core#8031
Eduard van Valkenburg (eavanvalkenburg) merged 6 commits into
microsoft:mainfrom
eavanvalkenburg:foundry-eval-ownership

Conversation

@eavanvalkenburg

@eavanvalkenburg Eduard van Valkenburg (eavanvalkenburg) commented Sep 3, 2026

Copy link
Copy Markdown
Member

Motivation & Context

Foundry evaluator dataset serialization currently lives in agent-framework-core, even though it emits the Foundry/OpenAI Evals message schema and is consumed only by FoundryEvals. This blurs the provider boundary and makes the conversion look related to provider-neutral evaluation orchestration or the Responses API.

This cleanup keeps core evaluation data and orchestration provider-neutral while making agent-framework-foundry responsible for its service wire format.

Description & Review Guide

  • What are the major changes?
    • Moved Foundry Evals message serialization into private helpers in agent-framework-foundry.
    • Replaced active uses of the mixed AgentEvalConverter class with a private core helper for provider-neutral EvalItem construction.
    • Retained AgentEvalConverter as a deprecated compatibility shim so released Foundry packages remain importable across their declared core dependency range.
    • Migrated ownership-specific tests, updated the direct-evaluation sample to construct EvalItem explicitly, and documented the package boundary without changing accepted ADRs.
  • What is the impact of these changes?
    • FoundryEvals keeps the same public API and wire payload behavior, and core retains EvalItem, local evaluation, evaluate_agent, and evaluate_workflow.
    • AgentEvalConverter remains importable for compatibility but emits DeprecationWarning when its static methods are used. New callers should construct the public EvalItem directly.
    • No dependency on an agent-framework-responses package is introduced.
  • What do you want reviewers to focus on?
    • Whether the core/Foundry ownership boundary is now clear and the existing Foundry Evals dataset payload remains unchanged.

Related Issue

N/A — ownership cleanup identified during Responses conversion analysis

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Keep provider-neutral EvalItem construction in core while moving the Foundry Evals wire conversion into agent-framework-foundry. Remove the accidental experimental converter export and migrate its tests, sample, and current package documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 3, 2026 10:09
@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python labels Sep 3, 2026
Preserve the EVALS feature-stage warning and metadata on the private EvalItem construction helper after removing AgentEvalConverter.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Apply the standard tool normalization path when constructing EvalItems so callable tools become FunctionTool instances. Simplify the Foundry tool-call sample to use @tool-decorated functions directly.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The linked accepted ADR contradicts the newly established serialization ownership boundary.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Moves Foundry-specific evaluation serialization from core into the Foundry provider package.

Changes:

  • Replaces AgentEvalConverter with private provider-neutral construction helpers.
  • Moves wire conversion and tests into Foundry.
  • Updates samples, exports, and boundary documentation.
File summaries
File Description
python/samples/05-end-to-end/evaluation/foundry_evals/README.md Documents explicit EvalItem usage.
python/samples/05-end-to-end/evaluation/foundry_evals/evaluate_tool_calls_sample.py Constructs typed tools and eval items directly.
python/packages/foundry/tests/test_foundry_evals.py Tests provider-owned wire conversion.
python/packages/foundry/README.md Documents evaluation ownership boundaries.
python/packages/foundry/agent_framework_foundry/_foundry_evals.py Adds Foundry wire serialization helpers.
python/packages/core/tests/core/test_evaluation.py Moves provider-neutral evaluation tests into core.
python/packages/core/AGENTS.md Records evaluation ownership guidance.
python/packages/core/agent_framework/_evaluation.py Replaces the converter with _to_eval_item.
python/packages/core/agent_framework/__init__.pyi Removes the converter type export.
python/packages/core/agent_framework/__init__.py Removes the converter runtime export.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread python/packages/foundry/agent_framework_foundry/_foundry_evals.py Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (2 commit(s)): db135abfe85a, 64de3c82b505
Model: gpt-5.6-sol-fast

Overview

This PR moves Foundry-specific wire serialization into the Foundry package and replaces the mixed core converter with a private provider-neutral EvalItem builder. The changed behavior is guarded by focused tests for item construction, conversation splitting, content serialization, tool handling, and submitted dataset payloads. The removed converter was explicitly part of the experimental EVALS surface, whose lifecycle contract permits removal without notice, so no Critical, High, or Medium defect remains.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

# Conflicts:
#	python/packages/foundry/README.md
Remove the stale accepted-ADR link from the Foundry Evals module and keep the tool-call sample's decorated tools directly in the agent and eval item definitions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAF Automated Review — Iteration 2

Result: No findings
Scope: 19 net-new commit(s): baf0ea5252eb, cb8800aa0b47, c3a8aec098c6, 1802dfb3dc61, b21954571bcf, a727aaf111f4, 95b6b4874547, 4e0c230d0aa2, 164719453c4a, ad0d6a992a71, ed8fc04f665c, 5ae2ab39c022, c79718f4db3e, 1a51fdd3eb4c, 1f7f4b3bd080, 4507512f95ef, cbf67b72ebec, 2394401d96c5, 977ebfcbe386
Model: gpt-5.6-sol-fast

Overview

The PR keeps provider-neutral EvalItem construction in core while moving Foundry wire serialization behind private provider helpers. Callable-tool normalization, MCP-tool deduplication, serializer edge-case coverage, and end-to-end payload tests provide concrete guardrails against behavior drift. No Critical, High, or Medium defect was established on a changed line in the authoritative incremental range.

Reviewed the supplied incremental change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

Comment thread python/packages/core/agent_framework/_evaluation.py
Keep the experimental converter import and static methods available so released Foundry packages remain compatible with their declared core 1.x range. Warn on legacy method use while modern Foundry continues to own active wire serialization.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merged via the queue into microsoft:main with commit 13108ed Sep 4, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants