Application-managed WebSocket sessions for extension-owned protocols #893
SummaryPraxis needs an opt-in way for a trusted extension to own a validated WebSocket session at the level of complete application messages. The immediate need is to let PraxisAI hydrate the Today, Praxis can accept a WebSocket upgrade and forward the resulting connection as a transparent byte tunnel. That is the right behavior when both sides speak the same application protocol, but it prevents an extension from receiving a complete message, performing asynchronous work, replacing or suppressing that message, initiating an independent upstream exchange, or producing downstream messages itself. Concrete motivationCurrent Codex reuses a persistent Responses WebSocket and, for eligible follow-up requests, sends only the new input while identifying the preceding response with The upstream transport is not always the same:
PraxisAI should be able to accept the same downstream Codex WebSocket, hydrate and validate each logical Responses request, and then either mediate a native upstream WebSocket or bridge the operation to HTTP/SSE. Requiring Codex to use its HTTP fallback discards its incremental WebSocket behavior. Requiring every backend to implement WebSockets makes backend transport an unnecessary gateway prerequisite. Passive observation is not sufficient. A read-only observer could extract metadata, but it could not hydrate a request, replace a message, wait for an external lookup, suppress forwarding, initiate vLLM's HTTP exchange, or synthesize downstream Responses events. Raw upgraded-body chunks are also not complete WebSocket message boundaries. Desired outcomePraxis core would provide a provider-neutral, opt-in application-managed WebSocket capability that:
Provider-specific Responses decoding, hydration, persistence, token accounting, and OpenAI/vLLM adapters would remain outside Praxis core. Non-goalsThis is not a proposal to make Praxis a general-purpose forward proxy, intercept arbitrary TLS traffic, persist raw WebSocket content, or require all WebSocket routes to use application management. Sign-off requestedDo maintainers agree that this problem belongs in Praxis core and that an application-managed WebSocket extension boundary is the appropriate capability to take into an EPIC and proposal PR? |
Replies: 1 comment
|
I agree that application-managed websockets makes sense given the scope of our project, and adding that to core in particular is the right place. Please feel free to start an initial proposal and reference this discussion. As for the non-goals: I feel like those non-goals are actually on shaky ground. I think it's fine to claim that we don't want to do some of these in the proposal, but I would phrase it as "not in this iteration" as opposed to never. cc @leseb |
I agree that application-managed websockets makes sense given the scope of our project, and adding that to core in particular is the right place. Please feel free to start an initial proposal and reference this discussion.
As for the non-goals: I feel like those non-goals are actually on shaky ground. I think it's fine to claim that we don't want to do some of these in the proposal, but I would phrase it as "not in this iteration" as opposed to never.
cc @leseb