mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-17 02:59:11 +02:00
* fix: resolve OpenAPI 3.x server variables in _create_default_client When an OpenAPI spec defines server variables (e.g. `https://{region}.api.example.com/v1`), the default values are now substituted before constructing the httpx client base URL. Previously, the URL was used as-is, causing all requests to fail for specs that use server variable templating. Fixes #1681 * fix: use str.replace instead of format_map for server variable substitution format_map applies Python string formatting rules, so variable names like {api.version} would be treated as attribute access and raise errors. Literal token replacement handles all valid OpenAPI variable names safely. * fix: task.wait() now returns on input_required instead of hanging Previously, wait() used a terminal-state allowlist (completed, failed, cancelled), so tasks entering input_required would hang until timeout. Replaced with inverse logic: return whenever the task exits the 'working' state. This handles input_required and any future blocking states without needing to update the allowlist. Fixes #3779 * fix: include submitted in in_progress_states to avoid premature return * fix: revert submitted, update state docstring to match MCP spec * fix: add _wait_terminal() so result() waits for completed/failed/cancelled wait() correctly returns on input_required for human-in-the-loop use cases, but result() needs to wait until the task fully resolves. Add a private _wait_terminal() helper that loops through non-terminal states and use it in all result() implementations. |
||
|---|---|---|
| .. | ||
| conftest.py | ||
| test_client_prompt_tasks.py | ||
| test_client_resource_tasks.py | ||
| test_client_task_notifications.py | ||
| test_client_task_protocol.py | ||
| test_client_tool_tasks.py | ||
| test_task_context_validation.py | ||
| test_task_result_caching.py | ||