Skip to content

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

Open
Serjbory wants to merge 1 commit into
microsoft:mainfrom
Serjbory:fix/6881-require-confirmation-docstring
Open

Python: Clarify require_confirmation docstring to reflect confirm_changes HITL gating#6884
Serjbory wants to merge 1 commit 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.

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

3 participants