mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-24 22:44:17 +02:00
* Retry when LLM returns text instead of calling final_response tool Instead of raising RuntimeError immediately when the LLM returns a text response instead of calling the `final_response` tool for structured output, retry up to 3 times with an explicit nudge message asking the model to use the tool. This mirrors the existing retry behavior for validation errors but with a separate, smaller cap. Fixes #3847 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add tests for text response retry logic Tests cover: - Text response followed by successful final_response (retry works) - Text response exceeding max retries (raises RuntimeError) - Nudge message appended to history on retry - No retry when result_type is None (text is valid) Addresses review feedback from PR review tool (v1 flagged missing tests as high severity). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Slim down text response retry tests Remove test_nudge_message_in_history (implementation detail). Reduce boilerplate in remaining 3 tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix ruff format Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| test_concurrent_dependencies.py | ||
| test_context_background_task.py | ||
| test_custom_subclass_tasks.py | ||
| test_notifications.py | ||
| test_progress_dependency.py | ||
| test_resource_task_meta_parameter.py | ||
| test_server_tasks_parameter.py | ||
| test_sync_function_task_disabled.py | ||
| test_task_capabilities.py | ||
| test_task_config.py | ||
| test_task_dependencies.py | ||
| test_task_elicitation_relay.py | ||
| test_task_meta_parameter.py | ||
| test_task_metadata.py | ||
| test_task_methods.py | ||
| test_task_mount.py | ||
| test_task_prompts.py | ||
| test_task_protocol.py | ||
| test_task_proxy.py | ||
| test_task_resources.py | ||
| test_task_return_types.py | ||
| test_task_security.py | ||
| test_task_status_notifications.py | ||
| test_task_tools.py | ||
| test_task_ttl.py | ||