Skip to content

Group & Display Interleaved Content - #916

Merged
AbhinRustagi merged 70 commits into
mainfrom
interleaved-content
Aug 4, 2026
Merged

Group & Display Interleaved Content#916
AbhinRustagi merged 70 commits into
mainfrom
interleaved-content

Conversation

@AbhinRustagi

@AbhinRustagi AbhinRustagi commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Agent runs that think between tool calls now render as one unit instead of scattered trays and lost text.

  • Group consecutive assistant/tool messages into a turn — one "Behind the scenes" timeline per run instead of one per message
  • Show the model's thinking as muted text rows between the tool entries, in the order they actually arrived (live runs track arrival order; stored runs use message order)
  • Only the final response feeds the Lang renderer — thinking no longer flashes as a fake answer, and the tray stays on "Working…" until the real response starts
  • Timeline is height-capped and scrolls internally, smoothly following new rows while streaming (stops when you scroll up, respects reduced motion)
  • Form-state saves now round-trip the thinking sections instead of silently deleting them
  • New optional messageGroup prop on AssistantMessageComponent — existing custom components are unaffected

No backend, stream-layer, or storage changes.

AbhinRustagi and others added 30 commits July 28, 2026 18:54
- ModelSwitcher: use @openuidev/react-ui (drop local model-switcher/); pass provider logos as {light,dark}
- Billing: replace local BillingCreditsDialog with dev-only OpenUICreditsModal from @openuidev/devtools
- LLM: swap createCloudChatLLM for fetchLLM + buildBody (429 flows via observability); hold LLM in a ref
- Cleanup: remove unused deps, cloud-chat-llm, chat-error, cloud-chat-constants, orphaned CSS/logos

Depends on #893 (packages) being merged + published first.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
Drops the local llmRef + selectedModelRef plumbing for useFetchLLM, which holds a stable instance and reads options fresh per send — buildBody closes over selectedModel directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…-lang/tailwind deps

- page.tsx: replace hand-rolled ChatLLM with fetchLLM (imported from @openuidev/react-ui), buildBody sends { messages }
- drop Tailwind (trivial usage): minimal globals.css reset, inline layout style, delete postcss.config.mjs
- package.json: remove @openuidev/react-headless, @openuidev/react-lang, tailwindcss, @tailwindcss/postcss; react-ui -> 0.13.3

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
Title :empty-hide and actions flex are library defaults after the thread.scss change; the openui-cloud-thread-header hook class is unreferenced.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
- route.ts: badRequest helper, NextResponse, model allowlist (reject unknown), propagate upstream errors with status — billing.ts deleted (store now surfaces server messages)
- theme: useSystemThemeMode from react-ui; delete use-system-theme.tsx; unwrap ThemeProvider in layout
- globals.css: trim to page shell + artifact compat (~18 lines); drop Tailwind + postcss.config.mjs + tailwind deps + vitest
- frontend-token: NextResponse, propagate upstream status

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…evtools to self-hosted

- cloud: ^0.14.0 / ^0.10.0
- self-hosted: react-ui ^0.14.0; OpenUIDevtools rendered dev-only in layout (devDependency)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
- cloud: drop OPENUI_MODEL, point at src/lib/models.tsx + /api/chat validation, list useFetchLLM/ModelSwitcher/devtools, pnpm-only
- self-hosted: add setup section (OPENAI_API_KEY), fix route path, pnpm-only

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…nAIAdapter

Drops the NDJSON re-encode (toReadableStream); propagates browser aborts via req.signal; model overridable with OPENAI_MODEL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
Scaffolded output changes substantially (react-ui 0.14 / react-headless 0.10, fetchLLM/useFetchLLM wiring, devtools, removed billing/tailwind) — minor bump, matching the package versioning rationale.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…s, trim comments

- import everything from @openuidev/react-ui (headless re-export); starters/prompt templates moved to src/lib/starters
- drop the now-trivial handleModelChange wrapper; use the logoPath const
- shorten route/model/component comments to the essentials (tool-loop's safety-rule docs kept)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…sed to provide it)

react-ui sets fonts per component, not on body — text that merely inherits fell back to the browser serif once Tailwind's preflight was removed. Same latent gap exists in the reference commit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…plate

Replaces the globals.css font-family fallback — next/font self-hosts Inter with built-in fallbacks, matching react-ui's --openui-font-body token.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
pr3khar and others added 17 commits August 4, 2026 11:45
The MCP server is a fixed demo default now — the env overrides only
existed to be documented in .env.example, so both go.

Co-authored-by: Cursor <cursoragent@cursor.com>
It was only there to exercise the timeline locally; the example keeps to
Cloud's built-in tools.

Co-authored-by: Cursor <cursoragent@cursor.com>
Both toggles lift their label to primary on hover, so the rows read as
expandable without a hover fill. Raw request/response containers take the
same border and radius as the sources list — a row expands into one or the
other, so they can't look like different kinds of container — and a subtle
tint separates the payloads from the sources, which keeps the plain
surface. Thinking prose moves to primary as the model's own voice, the
running icon pulses 0.6 -> 0.2, and the tray holds 24rem before scrolling.

Co-authored-by: Cursor <cursoragent@cursor.com>
Two ways the mask lied. scrollHeight and clientHeight are rounded while
rows are not, so a list that fits could report a pixel of overflow and
fade an edge it never scrolled past; overflow now has to clear 8px, and
each edge needs 4px of actual scroll offset.

The measurement also ran only when this component rendered, but whether a
row is expanded is the child's state — so the list could grow past its cap
and drop back under it with no render here, leaving the fade stuck on. A
ResizeObserver on the list catches both transitions, since its box is
content-sized right up to the cap. That also covers width changes, so the
window resize listener goes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Styling ::-webkit-scrollbar opts out of overlay scrollbars, so the bar
takes real width: the centered column jumped sideways the moment a message
got tall enough to scroll, e.g. on expanding a tool row. Reserve the
gutter up front.

Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts:
#	packages/react-ui/src/components/ToolCall/ToolCallTimeline.tsx
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openui-docs Ready Ready Preview Aug 4, 2026 3:49pm

Request Review

Comment thread packages/react-ui/src/components/AgentInterface/Thread.tsx Outdated

return (
<>
{group.map((message) => (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Remove this/ consolidate with if condition

onStateUpdate={handleStateUpdate}
initialState={initialState}
/>
{singleResponseStarted && (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Check for duplication

@AbhinRustagi
AbhinRustagi merged commit d88215f into main Aug 4, 2026
4 checks passed
@AbhinRustagi
AbhinRustagi deleted the interleaved-content branch August 4, 2026 15:53
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