Skip to content

feat(vercel-functions): WebSocket guidance + SSE/streaming clarification#102

Merged
Timer merged 1 commit into
mainfrom
websockets-skill-guidance
Jun 28, 2026
Merged

feat(vercel-functions): WebSocket guidance + SSE/streaming clarification#102
Timer merged 1 commit into
mainfrom
websockets-skill-guidance

Conversation

@Timer

@Timer Timer commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Stacked on #103 (manifest-ci-gate). Review/merge that first; this PR retargets to main automatically once it lands. The diff here is websockets content only — the workflow manifest correction lives in #103.

Summary

Vercel Functions now serve WebSocket connections natively (changelog, docs). This documents WebSockets across the skill set, steers users away from third-party realtime services and polling workarounds, and corrects the common belief that streaming/SSE needs the Edge runtime.

Changes

  • vercel-functions — new ## WebSockets section:
    • Request lifecycle (GET + Upgrade → Routing Middleware/rewrites/Firewall/rate limits), instance pinning + Fluid Compute concurrency, Active CPU pricing.
    • Examples: ws server, Socket.IO server + client (with the transports: ['websocket'] / path gotcha), Next.js experimental_upgradeWebSocket() from @vercel/functions, plus Express/Hono/Nitro and Python (FastAPI / python-socketio) notes.
    • Reconnect-with-backoff client example and persistent-state guidance (no instance affinity → external store, e.g. Marketplace Redis).
    • Discovery wiring: importPatterns (ws, socket.io, socket.io-client), retrieval, docs, and promptSignals — including workaround terms (long polling, pusher, pubnub, ably) so prompts reaching for a websocket substitute surface the native guidance.
  • vercel-functions Streaming — explicit callout that SSE/streaming works on the default Node.js runtime; no runtime = 'edge' needed.
  • knowledge-update — corrects the stale "Functions can't hold WebSocket connections" belief, adds that streaming/SSE is not Edge-exclusive, and reinforces that Edge is inferior in nearly every case.
  • lexical-index — adds polling/long-polling/pusher/ably to the realtime synonym group for the lexical fallback.
  • vercel.md — adds WebSockets to the Core Platform compute list and the Functions decision matrix.

Not labeled as beta, per request.

Verification

  • bun test878 pass, 0 fail; bun run validate passes; build:manifest:check + build:from-skills:check clean.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and generated skill metadata only; no runtime or application code paths change.

Overview
Documents native WebSockets on Vercel Functions and steers agents away from third-party realtime services and long-polling workarounds, while correcting the belief that streaming/SSE requires runtime = 'edge'.

vercel-functions adds a WebSockets section (ws, Socket.IO client/server gotchas, Next.js experimental_upgradeWebSocket(), reconnect/backoff, external store for state) plus discovery: websockets docs, importPatterns for ws / socket.io, retrieval aliases/intents, and promptSignals for websocket and long-polling terms. The Streaming section now states SSE/ReadableStream work on default Node.js (Fluid Compute).

knowledge-update adds bullets that Functions support WebSockets, streaming is not Edge-exclusive, and Edge should not be the default choice.

lexical-index expands the realtime synonym group with polling / long-polling. vercel.md lists WebSockets on the platform and in the Functions decision matrix. Regenerated skill-manifest.json / skill-catalog.md reflect the metadata changes.

Reviewed by Cursor Bugbot for commit ab930c3. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4b11d99. Configure here.

Comment thread generated/skill-manifest.json Outdated
@Timer Timer force-pushed the websockets-skill-guidance branch from 4b11d99 to aadbf8b Compare June 26, 2026 18:51
@Timer Timer changed the base branch from main to manifest-ci-gate June 26, 2026 18:51
@Timer Timer changed the title feat(vercel-functions): add WebSocket guidance + knowledge update feat(vercel-functions): WebSocket guidance + SSE/streaming clarification Jun 26, 2026
@Timer Timer force-pushed the websockets-skill-guidance branch from aadbf8b to 03b2a1b Compare June 26, 2026 19:00
Base automatically changed from manifest-ci-gate to main June 26, 2026 19:32
@Timer Timer force-pushed the websockets-skill-guidance branch from 03b2a1b to 8d04585 Compare June 26, 2026 19:35
…ication

Vercel Functions now serve WebSocket connections natively. Document this
across the skill set, steer users away from the polling workarounds people
reach for, and correct the common belief that streaming/SSE requires the
Edge runtime.

- vercel-functions: new "## WebSockets" section (request lifecycle, Fluid
  Compute requirement, Active CPU pricing) with ws, Socket.IO (server +
  client transport gotcha), Next.js experimental_upgradeWebSocket, and
  reconnect/persistent-state examples. Wire discovery via importPatterns
  (ws, socket.io, socket.io-client), retrieval, docs, and promptSignals.
- promptSignals trigger on the long-polling workaround technique, but
  deliberately NOT on named third-party services (Pusher, PubNub, Ably) —
  those are intentional choices, not a signal someone is working around a
  missing feature, so we don't nag.
- vercel-functions Streaming: call out that SSE/streaming works on the
  default Node.js runtime — no runtime='edge' needed.
- knowledge-update: correct the stale "Functions can't hold WebSocket
  connections" belief, add that streaming/SSE is not Edge-exclusive, and
  reinforce that Edge is inferior in nearly every case.
- lexical-index: add polling/long-polling to the realtime synonym group so
  the lexical fallback maps the workaround technique to websocket/realtime.
- vercel.md: add WebSockets to the compute list and Functions matrix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Timer Timer force-pushed the websockets-skill-guidance branch from 8d04585 to ab930c3 Compare June 26, 2026 19:51
@Timer Timer merged commit e566f76 into main Jun 28, 2026
4 checks passed
@Timer Timer deleted the websockets-skill-guidance branch June 28, 2026 02:20
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.

3 participants