mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-24 06:24:18 +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 | ||
| client | ||
| sampling | ||
| tasks | ||
| telemetry | ||
| transports | ||
| __init__.py | ||
| test_elicitation.py | ||
| test_elicitation_enums.py | ||
| test_logs.py | ||
| test_notifications.py | ||
| test_oauth_callback_race.py | ||
| test_oauth_callback_xss.py | ||
| test_openapi.py | ||
| test_progress.py | ||
| test_roots.py | ||
| test_sampling.py | ||
| test_sampling_result_types.py | ||
| test_sampling_tool_loop.py | ||
| test_sse.py | ||
| test_stdio.py | ||
| test_streamable_http.py | ||