* Added provider implementation for Azure AI V1
* Small fixes
* Fixed OpenAPI example
* Fixed local MCP example
* Fixed hosted MCP example
* Fixed file search sample
* Small fixes
* Resolved comments
* Doc updates
* Group chat refactoring Part 1; Next: HIL and handoff
* Add agent approval flow; next samples
* WIP: samples
* WIP: HIL samples
* Group chat HIL working; next: handoff
* Fix group chat tool approval sample
* WIP: refactor handoff; next handoff handling
* Handoff done; next handoff samples and concurrent and sequential
* Handoff samples, concurrent, and sequential done; next Magentic
* WIP: magentic; next test with samples + HIL
* Magentic Working; next fix all samples and tests
* Fix handoff samples; next tests
* WIP: fixing tests; some orchestration as agent samples are failing
* Group chat unit tests done
* Handoff unit tests done
* Remove old orchestration_request_info and fix related tests
* Magentic unit tests done
* Fix samples
* Fix test
* Fix test 2
* mypy
* Address comments
* Update readme
* Address comments
* Address comments 2
* Replace display name
* removed display_name, renamed context_providers, middleware and AggregateContextProvider
* fixes
* fixed test
* testfix
* removed mistakenly put back test
* updated new test
* rename middlewares to middleware
* middleware fixes
Eduard van Valkenburg
·
2026-01-13 02:24:07 +00:00
* feat(ag-ui): Add Pydantic request model and OpenAPI tags support
- Add AGUIRequest Pydantic model in _types.py with field descriptions
- Update add_agent_framework_fastapi_endpoint() to accept tags parameter
- Use AGUIRequest model for automatic validation and OpenAPI schema generation
- Export AGUIRequest and DEFAULT_TAGS in __init__.py
- Update test_endpoint.py to expect 422 for invalid requests
- Add tests for OpenAPI schema, default tags, custom tags, and validation
Benefits:
- Better API documentation with complete request schema in Swagger UI
- Automatic request validation with Pydantic
- Organized endpoints under 'AG-UI' tag instead of 'default'
- Improved developer experience and type safety
Fixes #<issue-number>
* test(ag-ui): Add test for internal error handling to achieve 100% coverage
- Add test_endpoint_internal_error_handling() to cover exception handling code
- Mock copy.deepcopy to simulate internal error during default_state processing
- Add type: ignore for FastAPI tags parameter (known pyright compatibility issue)
- Achieves 100% test coverage for _endpoint.py (previously missing lines 103-105)
When processing `input_json_delta` events, the Anthropic client was
passing the tool name from the previous `tool_use` event. This caused
ag-ui's `_handle_function_call_content` to emit a `ToolCallStartEvent`
for every streaming chunk (since it triggers on `if content.name:`).
This fix changes the behavior to pass an empty string for `name` in
`input_json_delta` events, matching OpenAI's behavior where streaming
argument chunks have `name=""`. The initial `tool_use` event still
provides the tool name, so only one `ToolCallStartEvent` is emitted.
Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
* fix Python: kwargs are not passed to _prepare_thread_and_messages in ChatAgent.run
Fixes#3118
* fix Python: [Bug]: model_id versus model_deployment_name is confusing in Azure AI Agents
Fixes#3147
* add types
* fixed type and docstring
Eduard van Valkenburg
·
2026-01-12 01:01:41 +00:00
* fix(ag-ui): execute tools after approval in human-in-the-loop flow
* Fix shared state bug
* Bug fix finalized
* Refactoring to clean up code
* Code cleanup
* More fixes
* More code cleanup
* Add version detection in __init__.py to ruff ignore list
* Improve DevUI, add Context Inspector view as new tab under traces
* fix mypy errors
* fix: Handle stale MCP connections in DevUI executor
MCP tools can become stale when HTTP streaming responses end - the underlying
stdio streams close but `is_connected` remains True. This causes subsequent
requests to fail with `ClosedResourceError`.
Add `_ensure_mcp_connections()` to detect and reconnect stale MCP tools before
agent execution. This is a workaround for an upstream Agent Framework issue
where connection state isn't properly tracked.
Fixes MCP tools failing on second HTTP request in DevUI.
fixes #1476#1515#2865
* fix#1572 report import dependency errors more clearly
* Ensure there is streaming toggle where users can select streaming vs non streaming mode in devui . Fixes .NET: [Python] DevUI tool call rendering in non-streaming mode?
* remove unused dead code
* improve ux - workflows with agents show a chat component in execution timelien, also ensure magentic final output shows correctly
* update ui build
* update devui to use instrumentation instead of tracing, other instrumentation and type/instance check fixes
* Fix MCP tool result serialization for list[TextContent]
When MCP tools return results containing list[TextContent], they were
incorrectly serialized to object repr strings like:
'[<agent_framework._types.TextContent object at 0x...>]'
This fix properly extracts text content from list items by:
1. Checking if items have a 'text' attribute (TextContent)
2. Using model_dump() for items that support it
3. Falling back to str() for other types
4. Joining single items as plain text, multiple items as JSON array
Fixes#2509
* Address PR review feedback for MCP tool result serialization
- Extract serialize_content_result() to shared _utils.py
- Fix logic: use texts[0] instead of join for single item
- Add type annotation: texts: list[str] = []
- Return empty string for empty list instead of '[]'
- Move import json to file top level
- Add comprehensive unit tests for serialization
* Address PR review feedback: fix type checking and double serialization
- Add isinstance(item.text, str) check to ensure text attribute is a string
- Fix double-serialization issue by keeping model_dump results as dicts
until final json.dumps (removes escaped JSON strings in arrays)
- Improve docstring with detailed return value documentation
- Add test for non-string text attribute handling
- Add tests for list type tool results in _events.py path
* Simplify PR: minimal changes to fix MCP tool result serialization
Addresses reviewer feedback about excessive refactoring:
- Reset _events.py to original structure
- Only add import and use serialize_content_result in one location
- All review comments addressed in serialize_content_result():
- Added isinstance(item.text, str) check
- Use model_dump(mode="json") to avoid double-serialization
- Improved docstring with explicit return value documentation
- Empty list returns "" instead of "[]"
* Refactor: Move MCP TextContent serialization to core prepare_function_call_results
Per reviewer feedback, moved the TextContent serialization logic from
ag-ui's serialize_content_result to the core package's
prepare_function_call_results function.
Changes:
- Added handling for objects with 'text' attribute (like MCP TextContent)
in _prepare_function_call_results_as_dumpable
- Removed serialize_content_result from ag-ui/_utils.py
- Updated _events.py and _message_adapters.py to use
prepare_function_call_results from core package
- Updated tests to match the core function's behavior
* Fix failing tests for prepare_function_call_results behavior
- test_tool_result_with_none: Update expected value to 'null' (JSON serialization of None)
- test_tool_result_with_model_dump_objects: Use Pydantic BaseModel instead of plain class
* Fix B903 linter error: Convert MockTextContent to dataclass
The ruff linter was reporting B903 (class could be dataclass or namedtuple)
for the MockTextContent test helper classes. This commit converts them to
dataclasses to satisfy the linter check.
* Pushing the bedrock related changes to the new branch after addressing the review comments
* 2524 Addressed the second round review comments
* 2524 Addressed few more minor comments on the PR
* resolving the merge conflict
* 2524 resolved the uv.lock conflicts
* 2524 addressed more comments
* 2524 removed the print statement to fix the checks failure
* 2524 resolved the CI failure issues
* 2524 fixing the CI breaks
* 2524 Addressed the review comment
* 2524 resolved conflict
---------
Co-authored-by: Sunil Dutta <sunil.dutta@penske.com>
Co-authored-by: budgetboardingai <apurva.sharma31@gmail.com>