mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
* Design doc: stateless session state * Add stateless session-state primitives: Scope, SessionCodec, scoped state * Add SessionProvider and Session() annotation for stateless session state * Rewrite session-state design to final shape (Session object, two patterns, no seal) * Rework stateless session state to final Session/SessionId design Remove Scope, SessionCodec/sealing, and scoped ctx.get_state. Add the Session object (get/set/delete/clear over one dict per (principal, session_id) key), injected session: Session (keyed by principal, requires auth), session_id: SessionId argument with auto-filled description, and SessionProvider contributing create_session/end_session. * Rename injected marker to UserSession; auto-wire SessionProvider on SessionId * Document stateless session state as a v4 feature * Require SessionProvider and make sessions create-then-validate Remove the implicit SessionProvider auto-wiring; a SessionProvider must now be registered explicitly. create_session records an owned session and get_session validates the id, rejecting uncreated or foreign ids. * Add Session.id (public id for session_id sessions, None for UserSession) * Fix ty: narrow Tool | None and ToolResult.structured_content in session tests * Fix session-provider enforcement gap for non-local tools; stop embedding raw principal in UserSession key * Fix disabled session_id tools blocking listing; reject local tools shadowing SessionProvider lifecycle names * Decouple SessionId description from lifecycle tool name so it survives namespaced mounts * Remove SessionProvider enforcement; get_session validation is the guarantee * Fix stale enforcement/key-format docs; document store-owned session TTL * Dedup SessionId contract description; tighten context.mdx session-state lead * Make session store/description resolution work in Docket task workers and for partial tools * Expose get_session as a standalone task-safe function; drop foreground-only Context.get_session * Move get_session to dependencies alongside the other request accessors * Reframe context state docs as Request State; cross-request persistence points to Session State * Address UserSession injection edge cases from review - inject a UserSession instance (not bare Session) so isinstance holds - support session: UserSession | None = None (inject None when unauth) - detect SessionId params past a partial's positional binding |
||
|---|---|---|
| .. | ||
| 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_cache_hints.py | ||
| test_completions.py | ||
| test_context.py | ||
| test_dependencies.py | ||
| test_dependencies_advanced.py | ||
| test_event_store.py | ||
| test_extensions.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_mrtr_guards.py | ||
| test_pagination.py | ||
| test_protocol_eras.py | ||
| test_providers.py | ||
| test_server.py | ||
| test_server_docket.py | ||
| test_server_lifespan.py | ||
| test_server_safety.py | ||
| test_session_provider.py | ||
| test_session_visibility.py | ||
| test_sessions.py | ||
| test_streamable_http_no_redirect.py | ||
| test_tool_annotations.py | ||
| test_tool_transformation.py | ||
| test_transport.py | ||