Skip to main content

Blog

Mode B hybrid streaming explained

6 min read · 2026-07-10

Why CodelessIQ splits chat tokens and job progress across two channels—and how jobId keeps them in sync.

Two channels, one job

Full app builds in CodelessIQ use Mode B (hybrid) streaming. The chat channel carries conversational tokens and tool UI via the Vercel AI SDK. The progress channel carries node lifecycle, sandbox status, and validation results via Server-Sent Events from the notification service.

Why split the streams?

Holding a single HTTP stream open for multi-minute sandbox work is fragile—proxies time out, tabs close, and users lose context. By enqueueing long jobs asynchronously and correlating both channels with a shared jobId, the UI stays responsive while work continues in the background.

What you see in the browser

  • Chat: planning summaries, clarifying questions, tool-call UI parts
  • SSE progress: Discovery → Planning → Edit → Review transitions, sandbox logs, lint/build pass or fail

Reconnecting safely

If you close the tab mid-build, reopen the workspace and resume SSE with the same jobId. Chat history restores from persistence; the job does not restart from scratch unless you explicitly retry.

When to use Mode A or C

Mode A (sync chat) suits short clarifications under ~60 seconds. Mode C (async job only) suits background rebuilds or disconnect-safe long runs. Mode B is the default for full Discovery → Review builds with sandbox validation.

← All posts · Read the docs