mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-19 20:14: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> |
||
|---|---|---|
| .. | ||
| auth | ||
| http | ||
| middleware | ||
| mount | ||
| providers | ||
| sampling | ||
| tasks | ||
| telemetry | ||
| transforms | ||
| versioning | ||
| __init__.py | ||
| test_app_state.py | ||
| test_auth_integration.py | ||
| test_auth_integration_errors.py | ||
| test_context.py | ||
| test_dependencies.py | ||
| test_dependencies_advanced.py | ||
| test_event_store.py | ||
| test_fastapi_testclient_compat.py | ||
| test_file_server.py | ||
| test_icons.py | ||
| test_input_validation.py | ||
| test_log_level.py | ||
| test_logging.py | ||
| test_pagination.py | ||
| test_providers.py | ||
| test_run_server.py | ||
| test_server.py | ||
| test_server_docket.py | ||
| test_server_lifespan.py | ||
| test_session_visibility.py | ||
| test_streamable_http_no_redirect.py | ||
| test_tool_annotations.py | ||
| test_tool_transformation.py | ||