Skip to content

Python: Forward function invocation kwargs through DevUI - #7355

Closed
hsusul wants to merge 1 commit into
microsoft:mainfrom
hsusul:fix-python-devui-function-invocation-kwargs
Closed

Python: Forward function invocation kwargs through DevUI#7355
hsusul wants to merge 1 commit into
microsoft:mainfrom
hsusul:fix-python-devui-function-invocation-kwargs

Conversation

@hsusul

@hsusul hsusul commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

DevUI accepts function_invocation_kwargs on its OpenAI-compatible response request, but the local agent executor previously dropped the mapping before calling agent.run(). Tools that depend on request-scoped values through FunctionInvocationContext.kwargs therefore failed when the same agent was invoked through DevUI.

Description & Review Guide

  • What are the major changes?
    • Added the optional function_invocation_kwargs field to AgentFrameworkRequest.
    • Forwarded the mapping through DevUI's agent execution path.
    • Added a focused regression test covering the request-to-agent handoff.
  • What is the impact of these changes?
    • DevUI-hosted agents can now receive request-scoped function invocation arguments consistently with direct agent.run() calls.
  • What do you want reviewers to focus on?
    • The optional request field and conditional forwarding in the local agent executor.

Related Issue

Fixes #7344

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.

Copilot AI review requested due to automatic review settings July 28, 2026 06:12
@hsusul
hsusul temporarily deployed to github-app-auth July 28, 2026 06:12 — with GitHub Actions Inactive
@hsusul
hsusul temporarily deployed to github-app-auth July 28, 2026 06:12 — with GitHub Actions Inactive
@hsusul
hsusul temporarily deployed to github-app-auth July 28, 2026 06:12 — with GitHub Actions Inactive
@hsusul
hsusul temporarily deployed to github-app-auth July 28, 2026 06:12 — with GitHub Actions Inactive
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Jul 28, 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

This PR fixes DevUI’s local agent execution path so request-scoped function_invocation_kwargs provided on the OpenAI-compatible request are preserved and forwarded into agent.run(...), restoring parity with direct agent.run(..., function_invocation_kwargs=...) calls and unblocking tools that read from FunctionInvocationContext.kwargs.

Changes:

  • Added optional function_invocation_kwargs to AgentFrameworkRequest (DevUI request model).
  • Forwarded request.function_invocation_kwargs through AgentFrameworkExecutor into agent.run(...) during agent execution.
  • Added a regression test verifying the request-to-agent handoff includes function_invocation_kwargs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
python/packages/devui/tests/devui/test_execution.py Adds a focused regression test asserting function_invocation_kwargs is passed to agent.run(...).
python/packages/devui/agent_framework_devui/models/_openai_custom.py Extends AgentFrameworkRequest with optional function_invocation_kwargs.
python/packages/devui/agent_framework_devui/_executor.py Conditionally forwards function_invocation_kwargs into the agent run call.

@eavanvalkenburg

Copy link
Copy Markdown
Member

this is a duplicate of #7352 closing

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.

Python: [Feature]: DevUI doesn't accept function_invocation_kwargs

3 participants