Replace assistant-ui with first-party chat primitives; loop-on-evented-engine, LibSQL write serialization, and stored-agent authors#17721
Replace assistant-ui with first-party chat primitives; loop-on-evented-engine, LibSQL write serialization, and stored-agent authors#17721mfrachet wants to merge 10 commits into
Conversation
…tool card, message row) The main agent chat is being migrated off @assistant-ui onto useChat + MessageFactory from @mastra/react, mirroring the agent-builder chat. This lands the foundational primitives behind the existing entry point so the runtime contract (streaming, approvals, OM lifecycle, live workflow graphs) is preserved when the mount is swapped. - ChatProvider: faithful port of MastraRuntimeProvider onto useChat, with a split context (messages, running/cancel, send) and the existing ToolCallProvider wired from useChat's stream/generate/network approval handlers so every badge keeps working unchanged. - ToolCard: dedicated component (replaces the renderToolCard idea and tool-fallback) taking plain props from MessageFactory; keeps useWorkflowStream + WorkflowRunProvider so dynamic workflow runs animate live. FileTreeBadge/SandboxExecutionBadge now take dataParts props instead of reading assistant-ui message state. - MessageRow: MessageFactory-driven rendering with role-specific chrome, props-driven markdown, reasoning, signal badges, tool routing into ToolCard, message-level error/warning/tripwire slots, and user dataset-save / attachment / system-reminder UI. DatasetSaveAction and Reasoning are now plain-prop and assistant-ui-free. All new MSW tests green (69 ai-ui tests); package typecheck clean. The mount swap and deletion of the assistant-ui runtime/adapters follow in a later step. Co-Authored-By: Mastra Code (anthropic/claude-opus-4-8) <noreply@mastra.ai>
…voice, thread shell, mount swap Complete the migration of the main agent chat off @assistant-ui onto useChat + MessageFactory. Rebuilds the thread shell and composer with local state, replaces the assistant-ui attachment/voice adapters with a self-contained composer-attachments module and a useReadAloud helper, swaps agent-chat.tsx onto the new ChatProvider, and deletes the legacy MastraRuntimeProvider / to-assistant-ui-message / tool-fallback / assistant-message / user-messages files and their tests. Removes the four @assistant-ui/* dependencies from packages/playground and @assistant-ui/react-ui (+ its CSS import) from packages/playground-ui, leaving zero @assistant-ui references in both packages. Tool calls/results, dynamic/streaming workflow execution (live WorkflowGraph), network routing, and agent-as-tool rendering are preserved and verified by MSW unit tests and a live browser smoke pass. Co-Authored-By: Mastra Code (anthropic/claude-opus-4-8) <noreply@mastra.ai>
… builder Extract the reusable chat-message building blocks so both the agent-chat and agent-builder surfaces compose the same leaves instead of maintaining parallel implementations: - Move Shimmer, the generic ToolCard shell, and a single-dot PendingIndicator into @mastra/playground-ui with colocated tests and barrel exports. - Add a shared ReasoningStreamingLine leaf and route agent-builder reasoning, text, tripwire, and warning rendering through the shared primitives. - Wire the missing Tripwire/Warning status slots into agent-builder. - Apply the 300ms pending-indicator grace delay on both surfaces. Also fix agent-chat rendering an empty "Hide reasoning" toggle/box for empty or redacted reasoning parts: Reasoning now renders nothing when there is no body and shows a clear label for redacted reasoning. Co-Authored-By: Mastra Code (anthropic/claude-opus-4-8) <noreply@mastra.ai>
When a user sends a message with an attachment, the playground composer emits each attachment as its own CoreUserMessage. The optimistic send path mapped each to its own MastraDBMessage, so streaming rendered the text and the attachment as two separate user bubbles while memory/reload showed one combined multi-part message. Merge all core user messages into a single optimistic MastraDBMessage so the streaming UI matches the persisted reload shape. The single bubble carries the clientMessageId so server echo reconciliation still matches. Co-Authored-By: Mastra Code (anthropic/claude-opus-4-8) <noreply@mastra.ai>
… chat User-attached images and files rendered blank in Studio chat while a response was streaming. Fix the file-part shape used by the streaming renderer so attachments display during streaming, matching how they appear after a page reload. Co-Authored-By: Mastra Code (anthropic/claude-opus-4-8) <noreply@mastra.ai>
🦋 Changeset detectedLatest commit: 0fae4de The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Keep optimistic user message keys stable during reconciliation and restore model-list response attribution in Playground so refactored chat rows preserve the prior user experience. Co-Authored-By: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Summary
This branch lands a set of related improvements across the Studio playground chat experience, the agentic loop engine, storage durability, and server-side author resolution.
Playground chat
@assistant-uidependency and replaces it with first-party chat primitives (provider, tool card, message row, composer, attachments, voice) shared across both the agent chat and the agent-builder.Core / loop engine
destroy()and a shutdown cascade.Storage durability
mergeWorkflowStepResultacross LibSQL/PG workflow snapshot updates, with a resilient fallback for non-serializable step results.Server
Voice (client-sdks/react)
Test plan
pnpm --filter ./packages/playground test→ 1070/1070 pass, typecheck cleanNotes
deleteWorkflowRunByIdin the LibSQL workflows store is not yet wrapped in the newwithClientWriteLock, unlike the other mutation paths.