mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-10 23:59:10 +02:00
* Restore task snapshot via a worker-level dependency `get_access_token()` returned `None` inside background tasks whenever `FASTMCP_DOCKET_URL` pointed at a `redis+cluster://` URL. The write side was fine — it went through `docket.redis()`, which is cluster-aware — but fastmcp kept a parallel sync Redis client just to read the snapshot back, and `Redis.from_url()` rejects the cluster scheme. Docket 0.19.1 ships worker-level dependencies that resolve per task in the same asyncio.Task as user code, so ContextVars propagate cleanly. That lets us load the snapshot once via `restore_task_snapshot` and drop the sync Redis path entirely. Sync helpers like `get_access_token()` and `get_http_request()` now just read a ContextVar; Docket is the sole Redis consumer. Closes #3897 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Revert TaskKey stub to a plain return NotImplementedError would fire at module import if anything evaluated the default; a no-op stub keeps the module usable without the fastmcp[tasks] extra, which is what we want. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <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_snapshot_restore.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_keys.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 | ||