Show immediate, accessible feedback after a user submits a chat turn and before the model service returns response headers or content.
Модель формирует ответ.useChat creates a client-only assistant message together with every new
optimistic user turn. Both messages use client-prefixed IDs. The optimistic turn
descriptor carries both IDs.
When /api/chat returns authoritative conversation, user-message, and
assistant-message IDs, reconciliation updates the optimistic IDs and replaces
the placeholder's status/content with the server assistant state. Streaming
chunks then update that reconciled message as they do today.
If the request fails before authoritative headers arrive, the hook updates the
client assistant placeholder to error or stopped. Client-only failed
assistant messages remain non-retryable because no server turn exists.
ChatMessage treats an empty streaming assistant as pending. It renders three
animated dots instead of textual filler. The animation is decorative and
hidden from assistive technology; a screen-reader label describes the state.
Reduced-motion users receive static dots through the existing Tailwind motion
variant.
Once content is non-empty, normal assistant text replaces the dots. Complete, error, and stopped rendering remains unchanged.
/api/chat resolves, the conversation contains optimistic
user and assistant messages in order.No API, database, Gateway, FinOps, model-adapter, or persisted-message schema changes are required. The change is limited to optimistic client state, assistant rendering, tests, and the resulting corp-ui deployment.