Conversation experience #
/conversations/<id> now opens the conversation's real Think transcript and a Kumo composer. Assistant output appears incrementally. Stop cancels the native server turn and keeps its saved partial response; Retry regenerates the last native branch without submitting the same user prompt again. Navigating away closes only the local connection, so durable work continues.
The selected conversation owns an AgentClient, public WebSocketChatTransport, AI SDK AbstractChat, and an immutable Octane external store. Shell navigation continues to own metadata only. There is no React chat adapter, client tool execution, transcript database, or replacement streaming parser. Existing Think persistence, native actions, recovery, scheduled execution, and the pinned finalizeResponse package patch remain unchanged.
The connection authenticates with a bounded, uncached history read before opening its socket and awaits native identity readiness. Protocol listeners are installed before connecting. Native broadcast helpers handle work started in other tabs; request ownership prevents applying the same deltas twice. Resume offers are acknowledged once per socket generation, including offers received before readiness. Pending handshakes use the native transport. Snapshot and HTTP revisions protect newer streaming content; native clear also invalidates old chat callbacks and activity pages. Terminal turns reconcile with server history before another action becomes available. Queued user messages can precede assistant messages in native history; the screen preserves that actual order.
A dropped connection retains the visible conversation while reconnecting. Authentication expiry and deleted conversations clear private messages, title, draft, and tool data. An uncertain submission must reconcile before Retry is available. If it was never saved, its text is retained for explicit restoration without replacing a newer draft. A failed regeneration restores the previous visible answer while checking server authority. These are browser presentation safeguards, not promises of exactly-once model or tool execution. Native restart recovery may retain a partial assistant row and append a continuation, or report an unrecoverable interrupted turn.
Markdown uses Marked's maintained framework-neutral token tree, rendered as escaped Octane elements. HTML stays inert and remote images do not load automatically. Links allow HTTP(S) and narrowly validated /tasks/<UUID> or /conversations/<UUID> application routes; protocol-relative, credential-bearing, control-character, backslash, JavaScript, and data URLs are rejected. Code uses public Kumo/Shiki with a bounded JavaScript-engine language set, plain escaped fallback while streaming or above 40,000 characters, horizontal scrolling within the message, and explicit copy failure feedback.
Sources come from native source-url parts or saved web/browser tool WebSource records, deduplicated by final URL within each assistant message. Search snippets, read pages, and browser pages retain their provenance labels. Schedule action results link to the real task editor. Compact tool rows join native tool call IDs to the safe live activity state, honor classified failures and recovery attempts, and expand actual escaped input/results with a 20,000-character detail limit. Earlier activity loads through the native 100-row cursor API; live updates cannot be downgraded by older pages.
The initial transcript renders the latest 40 messages, with 40 more on each Load earlier action and a preserved visual anchor. Deliberate upward scrolling stops following output; Jump to latest and sending repin it. Resize observation accounts for code highlighting and disclosures. Up to 30 conversation scroll positions live only in mounted browser memory. Think's history endpoint returns the complete array, so this rendering window does not reduce full-history network transfer or controller memory. Native history pagination is not available in this SDK.
pnpm test:chat-ui uses the actual release frontend and a test-only Worker with deterministic MockLanguageModelV3 inference. Authentication, Think facets, sockets, streaming, tools, SQLite history, cancellation, and recovery are real. The fixture has an explicit stable Wrangler name and persistence directory across full Worker restart. This validates the application integration, not a deployed provider/account call. The gate covers incremental output and reload, Markdown/code/source/tool safety, mobile layout, offline/replay/pending/lost probes, two-tab Stop, owning-tab Stop, native Retry, accepted and unaccepted send failures, queued snapshots, route/clear staleness, long-history anchoring, upward reading, restart continuation, session expiry, deletion, and private SSR.
Primary API references: Cloudflare Think, Marked token pipeline. Installed native Agents 0.22.0, Think 0.17.0, and AI 7.0.93 declarations and implementations control the integration.