Repository navigation
Python: Preserve reusable declarative model options - #9068
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoOct 12, 2026
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
Conversation
LI (ktz03)
temporarily deployed
to
github-app-auth
October 5, 2026 17:00 — with
GitHub Actions
Inactive
LI (ktz03)
temporarily deployed
to
github-app-auth
October 5, 2026 17:14 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix preserves existing behavior while adequately covering reusable definitions and input immutability.
Review effort: Balanced
Findings: None
What changed in this PR
Preserves reusable declarative model options by avoiding mutation while extracting chatToolMode.
Changes:
- Copies additional properties before parsing tool choice.
- Adds sync and async regression coverage for all supported tool modes.
| File | Description |
|---|---|
python/packages/declarative/agent_framework_declarative/_loader.py |
Prevents mutation of caller-provided options. |
python/packages/declarative/tests/test_declarative_loader.py |
Tests repeated sync and async agent creation. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
LI (ktz03)
marked this pull request as ready for review
October 9, 2026 02:33
LI (ktz03)
temporarily deployed
to
github-app-auth
October 9, 2026 02:33 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Oct 12, 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
Creating an agent consumes
chatToolModefrom the caller'sModelOptions.additionalProperties. Reusing the same definition therefore gives later agents different tool-choice settings and changes the caller's configuration. Sync and async agent creation should preserve reusable definitions.Description & Review Guide
chatToolMode. Add eight public-factory regressions covering repeated sync and async creation withauto,required,none, and an omitted tool mode.Related Issue
Fixes #9066
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.