mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
* Fix GoogleGenaiSamplingHandler thought part leaking and unhelpful errors - Filter thought parts (part.thought=True) from response content instead of leaking them as TextContent in _response_to_result_with_tools - Include finish_reason in error messages when no content is found, so safety-filtered responses (SAFETY, RECITATION, etc.) are distinguishable - Add specific error message for thinking-only responses in _response_to_create_message_result Fixes #3846 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add tests for thought part filtering and error message improvements Tests cover: - Thought parts filtered from tool-path responses - Thought-only responses produce descriptive errors - Safety-filtered responses include finish_reason in error - Normal responses (text + function calls) unaffected Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix ruff format and ty check issues Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix ty check errors in tests Remove unused ty: ignore comments from lines where isinstance() narrows the type, and add correct ty: ignore[invalid-argument-type] and ty: ignore[not-subscriptable] comments on lines in newly added test functions where ty cannot infer the union type is a list. Also apply ruff format fix in test_task_return_types.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix: use all() not any() for thinking-only detection Addresses review feedback: any() would misclassify mixed responses (thought + function_call) as thinking-only, hiding the real error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| handlers | ||
| __init__.py | ||