Skip to content

Python: Clarify require_confirmation docstring to reflect confirm_changes HITL gating#6884

Merged
moonbox3 merged 2 commits into
microsoft:mainfrom
Serjbory:fix/6881-require-confirmation-docstring
Jul 14, 2026
Merged

Python: Clarify require_confirmation docstring to reflect confirm_changes HITL gating#6884
moonbox3 merged 2 commits into
microsoft:mainfrom
Serjbory:fix/6881-require-confirmation-docstring

Conversation

@Serjbory

@Serjbory Serjbory commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Fixes #6881

The require_confirmation parameter on AgentFrameworkAgent and AgentConfig (in agent-framework-ag-ui) was documented as only affecting predictive state updates:

require_confirmation: Whether predictive updates require user confirmation before applying

However, in _run_common.py the same flag is the master switch that gates whether a synthetic confirm_changes tool call is emitted for function-approval requests (tools with approval_mode="always_require") — the mechanism a human-in-the-loop frontend relies on to render an approval prompt. Setting require_confirmation=False silently disables the approval UI for gated tools, which the docstring gave no hint of.

Description

Documentation-only change. Updates the require_confirmation docstring in both AgentConfig.__init__ and AgentFrameworkAgent.__init__ to describe its actual dual purpose:

  • When True (default): emits a confirm_changes tool call for approval-gated tools (so a HITL frontend can prompt for approval) and requires confirmation for predictive state updates.
  • When False: no confirm_changes call is emitted; tools remain gated server-side.

No behavior change.

Contribution Checklist

  • The code builds clean without any errors or warnings (uv run poe syntax passes)
  • I didn't break anyone 😄 (docs-only)

Copilot AI review requested due to automatic review settings July 2, 2026 13:06
@giles17 giles17 added the python Usage: [Issues, PRs], Target: Python label Jul 2, 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.

Pull request overview

Updates the Python AG-UI wrapper documentation to accurately describe what require_confirmation controls in AgentConfig and AgentFrameworkAgent: it not only gates confirmation for predictive state updates, but also whether the synthetic confirm_changes tool call is emitted for approval-gated tool flows (used by HITL frontends to render an approval prompt).

Changes:

  • Clarified the require_confirmation docstring in AgentConfig.__init__ to cover both predictive updates and HITL approval prompting via confirm_changes.
  • Clarified the require_confirmation docstring in AgentFrameworkAgent.__init__ to match the actual runtime gating behavior.

@moonbox3 moonbox3 enabled auto-merge July 7, 2026 05:30
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/ag-ui/agent_framework_ag_ui
   _agent.py44295%71, 131
TOTAL44212524488% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
8890 33 💤 0 ❌ 0 🔥 2m 30s ⏱️

@moonbox3 moonbox3 added this pull request to the merge queue Jul 14, 2026
Merged via the queue into microsoft:main with commit 6c0950a Jul 14, 2026
37 checks passed
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

5 participants