Skip to content

Python: Tool name whitespace bugfix - #9557

Merged
Jose Alvarez (jpalvarezl) merged 1 commit into
microsoft:mainfrom
westey-m:python-toolname-whitespace-bug
Oct 21, 2026
Merged

Jose Alvarez (jpalvarezl) merged 1 commit into
microsoft:mainfrom
westey-m:python-toolname-whitespace-bug

Conversation

@westey-m

Copy link
Copy Markdown
Collaborator

Motivation & Context

  • Don't strip whitespace from tool names, since it may cause clashes.

Description & Review Guide

Related Issue

Fixes #

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details:

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 links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • 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.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 11:24
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Oct 20, 2026
@github-actions github-actions Bot changed the title Tool name whitespace bugfix Python: Tool name whitespace bugfix Oct 20, 2026

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.

🟢 Approval recommended

The focused fix preserves tool identity, includes regression coverage, and has no identified blocking issues.

No open issues 🎉

What changed in this PR

Preserves exact tool names in Python approval rules, preventing whitespace-distinct names from being conflated.

Changes:

  • Retains tool-name whitespace while still rejecting blank names.
  • Adds regression coverage for construction and serialization round trips.
File Description
python/​packages/​core/​tests/​core/​test_harness_tool_approval.py Tests whitespace preservation and serialization.
python/​packages/​core/​agent_framework/​_harness/​_tool_approval.py Stores the original tool name without trimming.

Review effort: Balanced

@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 (1 commit(s)): 4aa6c1402a0d
Model: gpt-5.6-sol

Overview

The change preserves the exact approved tool identity while retaining rejection of empty and whitespace-only rule names. Exact name matching, trusted pending-request rebinding, hosted-server and argument boundaries, and the new serialization round-trip test constrain the changed behavior. No publishable Critical, High, or Medium concern was established.

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.

@jpalvarezl
Jose Alvarez (jpalvarezl) added this pull request to the merge queue Oct 21, 2026
Merged via the queue into microsoft:main with commit 6b48d20 Oct 21, 2026
53 of 54 checks passed

This branch was successfully deployed

1 active deployment
github-app-auth — 4aa6c140 Deployed Oct 20, 2026 by westey-m via team_check #7101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants