Files
microsoft--agent-framework/python/packages
Manjunath Janardhan 24a383613b Python: feat: forward function_invocation_kwargs through DevUI to agent.run (#7779)
DevUI's /v1/responses endpoint builds agent.run() kwargs by hand and only
passed stream/session, so tools that read request-scoped values via
FunctionInvocationContext.kwargs (tenant id, auth token, user id)
silently received nothing when the agent was run through DevUI. The same
agent works correctly outside DevUI via agent.run(..., function_invocation_kwargs=...).

Forward function_invocation_kwargs from the request into agent.run() in
AgentFrameworkExecutor._execute_agent. Accepts both channels already used
on the request payload:
  - extra_body.function_invocation_kwargs (the channel already used for
    response_id / checkpoint_id)
  - top-level extra field (AgentFrameworkRequest has ConfigDict(extra="allow"))
Top-level takes precedence when both are set. Non-dict / missing values
are silently ignored for backward compatibility. No frontend / model
changes.

Adds a parametrized regression test in test_execution.py covering all
three cases (extra_body, top-level, absent).

Fixes #7344
2026-08-21 06:28:36 +00:00
..