Skip to content

Reuse proxy backend sessions within requests - #4860

Draft
jakekaplan wants to merge 1 commit into
mainfrom
feat/proxy-request-sessions
Draft

Reuse proxy backend sessions within requests#4860
jakekaplan wants to merge 1 commit into
mainfrom
feat/proxy-request-sessions

Conversation

@jakekaplan

Copy link
Copy Markdown
Collaborator

Proxy component resolution and execution previously opened separate backend client lifetimes, so one frontend call could negotiate with the backend more than once. ProxyProvider now lazily retains one isolated backend session for the root request and disconnects it during request cleanup; concurrent requests remain isolated and local component calls do not wake the backend.

The default is request scope, while stateful integrations can preserve their deliberate connection lifecycle explicitly:

provider = ProxyProvider(lambda: ProxyClient(backend))
stateful_provider = ProxyProvider(
    stateful_client.new_stateful,
    session_scope="operation",
)

🤖 Generated with OpenAI GPT-5.6

🤖 Generated with OpenAI GPT-5.6
@marvin-context-protocol marvin-context-protocol Bot added breaking change Breaks backward compatibility. Requires minor version bump. Critical for maintainer attention. enhancement Improvement to existing functionality. For issues and smaller PR improvements. server Related to FastMCP server implementation or server-side functionality. labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaks backward compatibility. Requires minor version bump. Critical for maintainer attention. enhancement Improvement to existing functionality. For issues and smaller PR improvements. server Related to FastMCP server implementation or server-side functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant