Skip to content

Python: [Bug]: Missing fields in AGUIRequest cause client_tools loss in DefaultOrchestrator #3350

Description

@dark-lbp

Description

Description

The AGUIRequest model in agent_framework_ag_ui/_types.py is missing several fields defined in the RunAgentInput specification (specifically tools , context , and forwarded_props ).
This omission causes Pydantic to filter out these fields during request validation. Consequently, downstream logic in _orchestrators.py fails to retrieve client-side tools, breaking the Copilot Actions functionality.

References

Technical Details & Impact Analysis

  1. Data Loss at Ingestion :
    In _endpoint.py , the request is parsed using AGUIRequest :
# _endpoint.py
input_data = request_body.model_dump(exclude_none=True)

Since AGUIRequest lacks the tools field, model_dump excludes it from input_data .

  1. Logic Failure in Orchestrator :In _orchestrators.py , the code attempts to retrieve tools from input_data :
# _orchestrators.py L394-395
client_tools = convert_agui_tools_to_agent_framework(context.input_data.get("tools"))
approval_tool_name = select_approval_tool_name(client_tools)

Because tools was stripped earlier, context.input_data.get("tools") returns None . As a result, client_tools is empty, and the agent is unaware of any client-side capabilities.

Suggested Fix

Update AGUIRequest in agent_framework_ag_ui/_types.py to include the missing fields:

class AGUIRequest(BaseModel):
    """Request model for AG-UI endpoints."""
    
    # ... existing fields ...
    
    # Add missing fields to match RunAgentInput
    tools: list[dict[str, Any]] | None = Field(
        None, 
        description="List of tools available to the agent"
    )
    context: list[dict[str, Any]] | None = Field(
        None, 
        description="List of context objects provided to the agent"
    )
    forwarded_props: dict[str, Any] | None = Field(
        None, 
        description="Additional properties forwarded to the agent"
    )
    parent_run_id: str | None = Field(
        None, 
        description="Optional parent run identifier"
    )

Code Sample

Error Messages / Stack Traces

Package Versions

agent-framework-core: python-1.0.0b260116

Python Version

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugUsage: [Issues], Target: all issues (Legacy, prefer issue type: bug)pythonUsage: [Issues, PRs], Target: Python

Type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions