Repository navigation
feat(protocol): a website extra brings the WebSocket library a site's server needs - #947
Open
earakely-scale wants to merge 2 commits into
Open
earakely-scale wants to merge 2 commits into
earakely-scale wants to merge 2 commits into
Conversation
… server needs WebsiteEnvironment.serve() runs uvicorn, and uvicorn without a WebSocket library serves a WebSocket upgrade as a plain GET, which the site answers 404; the page sees the socket close with 1006. The new website extra installs uvicorn with websockets, serve()'s ImportError names it, and the protocol README says to install it in a site's image. A gateway test deploys a site whose mounted app answers a WebSocket, built with the extra, and checks its opening messages and a ping through /website/<name>/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
WebsiteEnvironment.serve()runs the site with uvicorn. Without a WebSocket library, uvicorn serves a WebSocket upgrade as a plain GET. The site answers 404, and the page sees the socket close with code 1006. A site whose image installs only uvicorn (asserve()'s old ImportError suggested) or the protocol's base package can't answer a page's WebSocket, and nothing says why.What
agentenv-framework-protocol[website]: a new extra with uvicorn and websockets, the same floors as theappandcomputerextras.serve()'s ImportError names the extra, and its docstring says what the extra brings.uv.lockgains only the extra's entries (re-locked with the uv CI pins, 0.13.1).Tests
New
test_gateway_relays_a_website_environments_websocket(slow tier,gateway_test.py):WebsiteEnvironmentsite fromtst/data/socket_website. The site's mounted Starlette app answers/socket, and its image installs this checkout's protocol package with[website]./website/sockets/socketroute, it checks that the site's two opening messages arrive on connect and that apingis answered withpong.Run on a Linux host with Docker and the local registry:
1 passed in 403.22s.uvicorn>=0.30(no websockets): it fails withwebsockets.exceptions.InvalidStatus: server rejected WebSocket connection: HTTP 404. The test catches exactly this case.Docs
The docs site's website-environment page should say to install
agentenv-framework-protocol[website]in a site's image when the site serves itself withserve(). A page that opens a WebSocket needs it.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Adds a
websiteextra with uvicorn and websockets, updates install guidance, and adds a gateway WebSocket test.Reviews (2) · Last reviewed commit: "test(gateway): name the WebSocket test's..." · Reviewed by Greptile