Skip to content

docs: add guidance for apps with persistent connections (SSE/WebSocket)#739

Open
mecampbellsoup wants to merge 1 commit intovercel-labs:mainfrom
mecampbellsoup:docs/networkidle-sse-guidance
Open

docs: add guidance for apps with persistent connections (SSE/WebSocket)#739
mecampbellsoup wants to merge 1 commit intovercel-labs:mainfrom
mecampbellsoup:docs/networkidle-sse-guidance

Conversation

@mecampbellsoup
Copy link

Summary

  • Adds a "Apps with Persistent Connections (SSE, WebSockets)" subsection under "Timeouts and Slow Pages" in skills/agent-browser/SKILL.md
  • Explains why wait --load networkidle always times out on apps with SSE, WebSocket, or long-polling connections
  • Provides alternative wait strategies: domcontentloaded, element waits, text waits, JS condition waits

Context

We hit this while using agent-browser to QA a Django app that maintains an SSE connection on every authenticated page (for real-time chat updates). wait --load networkidle timed out every time because Playwright's networkidle requires zero network activity for 500ms, which never happens with a persistent connection.

The current SKILL.md recommends networkidle in multiple code examples without noting this limitation. This affects any app using SSE, WebSockets, long-polling, or similar persistent connection patterns — which includes most real-time web apps (chat, dashboards, collaborative editors, notification systems).

Related to #479 (changing open default to domcontentloaded).

Test plan

  • Verified the timeout behavior against a real SSE app
  • Confirmed wait --load domcontentloaded works as a replacement
  • Review: does this section belong here or in references/commands.md?

🤖 Generated with Claude Code

`wait --load networkidle` always times out on apps with SSE, WebSocket,
or long-polling connections because the network is never idle. This is a
common stumbling block — the SKILL.md currently recommends networkidle
in multiple places without noting this limitation.

Adds a subsection under "Timeouts and Slow Pages" explaining the issue
and recommending alternatives: domcontentloaded, element waits, text
waits, and JS condition waits.

Related to vercel-labs#479

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 12, 2026

@mecampbellsoup is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@ctate ctate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch — I hit the same timeout on a test SSE server and confirmed all four alternatives work. Two small asks: update the networkidle code comment to something like # Wait for zero network activity for 500ms (times out if page uses SSE/WebSocket), and add a "see below" note on the paragraph right above your new section so readers get the heads-up before copy-pasting networkidle. Otherwise this is good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants