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> |
||
|---|---|---|
| .. | ||
| apps | ||
| cli | ||
| client | ||
| conformance | ||
| contrib | ||
| deprecated | ||
| experimental | ||
| fs | ||
| integration_tests | ||
| prompts | ||
| resources | ||
| server | ||
| telemetry | ||
| tools | ||
| utilities | ||
| __init__.py | ||
| conftest.py | ||
| test_apps.py | ||
| test_apps_prefab.py | ||
| test_fastmcp_app.py | ||
| test_json_schema_generation.py | ||
| test_mcp_config.py | ||