- Introduced a utility function `create_task_with_error_handling` to manage asyncio tasks with proper exception logging and suppression options.
- Updated multiple components, including `SessionManager`, `BrowserSession`, and various watchdogs, to utilize the new error handling mechanism for background tasks.
- Enhanced overall robustness of asynchronous operations by ensuring exceptions are logged and handled appropriately, improving maintainability and debugging capabilities.
- Enhanced _json_schema_to_python_type to recursively handle array item types
- Arrays with ''items'' schema now properly return list[item_type] instead of plain list
- Supports nested types like list[str], list[float], and list[CustomModel]
- Added comprehensive test for array type inference in test_mcp_array_type_inference
This allows MCP tools with array parameters to have proper type hints and validation,
fixing issues where array parameters were losing their item type information.
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>
- Fix test assertion: change assert result.success to assert result.success is not False
- Fix MCP parameter serialization: use model_dump(exclude_none=True) to exclude None values
- Fix pyright type checking errors: add proper type guards and use getattr for dynamic access
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>
- Add ConfigDict import from pydantic
- Fix default value handling for optional fields with proper type annotations
- Improve nested model creation with error handling and ConfigDict configuration
- Apply same improvements to main parameter model creation
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>
- Modified _json_schema_to_python_type to recursively create nested Pydantic models for object types with properties
- Fixed issue where nested object properties were being lost during parameter processing
- Added test_mcp_nested_object_parameters to verify nested objects are properly preserved
- Updated MockMCPServer to include process_trace_update tool with nested object schema
Fixes#2453
Co-authored-by: Nick Sweeting <pirate@users.noreply.github.com>