assistant-ui-runtime

Manage Assistant UI thread and message runtime state with React hooks.

182|8|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/compozy/agh --skill assistant-ui-runtime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: assistant-ui-runtime
Source: https://github.com/compozy/agh/tree/main/.agents/skills/assistant-ui/assistant-ui-runtime
Command: npx skills add https://github.com/compozy/agh --skill assistant-ui-runtime

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

assistant-ui-runtime helps you correctly manage Assistant UI runtime state—threads, messages, and events—so your app stays in sync while chat is running, edited, canceled, or regenerated.

Core Features & Use Cases

  • Runtime hierarchy you can reason about: Manage thread lists and the active thread, including per-composer input state and per-message content parts.
  • Modern state access API: Use useAui, useAuiState, and useAuiEvent to read state safely and react to lifecycle events like message sends and run start/end.
  • Deterministic thread & message operations: Append messages, cancel runs, edit/reload messages, and inspect capabilities (cancel/edit/reload/copy/speak/attachments).
  • Reference-backed adapter patterns: Use documented approaches for local runtime (custom model adapters) and external store runtime (Redux/Zustand/custom message stores) while keeping the UI operational.

Quick Start

Use the assistant-ui runtime hooks to read thread.messages and thread.isRunning, then append a user message and listen for composer.send to confirm it was submitted.

Frequently Asked Questions about assistant-ui-runtime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage chat thread state and message lifecycle in a React assistant UI?

To manage chat thread state in a React assistant UI, use an AssistantRuntimeProvider-compatible runtime with useAui, useAuiState, and useAuiEvent hooks. This setup synchronizes thread lists, message content parts, and composer context during sends, edits, and reloads.

Why does my Streamlit-style chat UI lose runtime state when canceling or editing a message?

Chat UI runtime state drops during message edits or cancellations when thread and message updates are applied inconsistently. Defining deterministic runtime state shapes for threads and events like runStart and runEnd prevents this desync.

Can I use Redux or Zustand to manage assistant-ui thread lists and message stores?

Yes, you can integrate Redux or Zustand with assistant-ui by implementing an external store runtime adapter. This pattern connects your custom message stores to the AssistantRuntimeProvider, keeping the UI operational while managing thread lists externally.

What is the best way to handle runStart and runEnd event hooks for chat message regeneration?

The best way to handle runStart and runEnd event hooks for message regeneration is using the useAuiEvent accessor. It listens for lifecycle events, allowing your app to react to run boundaries and update the UI deterministically during reload workflows.

Does assistant-ui require a specific runtime provider to inspect message capabilities like copy and attachments?

Yes, assistant-ui requires an AssistantRuntimeProvider-compatible runtime to inspect message capabilities. The runtime exposes hooks that allow you to check if operations like cancel, edit, reload, copy, speak, and attachments are supported for each message.