fix(tracey): migrate to the assistant-ui 0.15 aui state API - #521
Merged
Conversation
The `@assistant-ui/react` 0.14 -> 0.15 bump (npm-minor-patch group) removed the per-scope context hooks (`useThread`, `useComposer`, `useComposerRuntime`, `useMessage`) in favour of the unified assistant client: `useAuiState(selector)` for state and `useAui()` for the bound scope clients. The Tracey components still imported the removed hooks, so `tsc -b` failed and broke both the CI frontend job and the E2E image build. Rewrite the six call sites against the new API — the selector state shapes (`ThreadState`, `ComposerState`, `MessageState`) are unchanged, so each hook maps 1:1 onto the matching scope of `AssistantState`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BKaLraZrphUMWRwFQGWWzD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI on
masteris red since thenpm-minor-patchgroup bump (#515), and E2E is red for the same reason.@assistant-ui/reactwent0.14.28 -> 0.15.1, which removed the per-scope context hooks:tsc -bfails, so the CIfrontendjob fails and the E2EfrontendDocker stage fails to build (target frontend-free: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 2). No other job onmasteris failing — backend, CodeQL and the earlier E2E runs were green.What changed
0.15 replaces
useThread/useComposer/useComposerRuntime/useMessagewith the unified assistant client —useAuiState(selector)for state anduseAui()for the bound scope clients. The selector state shapes (ThreadState,ComposerState,MessageState) are unchanged, so every call site maps 1:1 onto the matching scope ofAssistantState:useThread(t => t.isRunning)useAuiState(s => s.thread.isRunning)useComposer(c => c.text)useAuiState(s => s.composer.text)useComposerRuntime()useAui().composeruseMessage(m => …)useAuiState(({ message: m }) => …)Six call sites:
TraceyComposer,TraceyChatPanel,ToolChips,FollowUpSuggestions,MessageStatusBar,AwaitActionsToolUI. No behavior change — same selectors, samesetText/sendcalls.frontend/docs/TRACEY.mdupdated where it quoted the old hook.Verification
npm run build(tsc -b && vite build) — green, the failing job's exact commandnpm test -- src/features/tracey— 25 files / 295 tests passednpm run lint— 0 errors (one pre-existing warning inuseTraceVirtualizer.ts, unrelated)E2E is left to CI, since it only needed the frontend image to build.
No changelog entry: this restores the build after a dependency bump and changes nothing user-facing.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BKaLraZrphUMWRwFQGWWzD
Generated by Claude Code