playbook/antigravity-awesome-skills/skills/vercel-optimize/references/support-topics/workflow-resumable-stream-r...

1.2 KiB

id title status candidateKinds frameworks routePatterns priority citations maxBriefChars
workflow-resumable-stream-routes Workflow resumable stream routes active
slow_route
*
(^|/)api/.*/stream/?$
(^|/)chat/.*/stream/?$
[id].*/stream
98
https://workflow-sdk.dev/docs/ai/resumable-streams
https://workflow-sdk.dev/docs/foundations/streaming
https://vercel.com/docs/workflow
850

Investigation Brief

Stream-shaped routes may be Workflow SDK reconnection endpoints. Long wall-clock duration can be the live client connection.

Evidence To Check

Look for WorkflowChatTransport, getRun, run.getReadable, startIndex, x-workflow-run-id, x-workflow-stream-tail-index, getWritable, or createUIMessageStreamResponse. Compare CPU, TTFB, wall-clock. Check full replay, missing tail-index, unreleased locks, or unclosed streams.

Do Not Recommend When

Do not cache stream endpoints or remove resumability. Do not call high duration a bug when CPU is low, TTFB is healthy, and the route only holds a client connection.

Verification

Name whether the route starts or reconnects a run, then cite the exact waste: replay, missing tail-index, lock leak, unclosed stream, high CPU, or avoidable pre-first-byte work.