fix(ui): bump @assistant-ui/react to 0.14.24 to fix thread render crash #175

Merged
dries merged 1 commit from fix/assistant-ui-thread-index-crash into main 2026-06-28 23:02:17 +02:00
Owner

Problem

Loading some sessions (e.g. ses_0f4b12f21ffe3gZ97LqF9aNtyw) crashed the thread with Safari's generic "The string did not match the expected pattern". The real error, logged via the client error forwarder, was:

tapClientLookup: Index 1 out of bounds (length: 1)
tapClientLookup: Index 60 out of bounds (length: 33)

Thrown from @assistant-ui/store's tapClientLookup during render of ToolGroup → MessagePrimitive.Parts → ThreadPrimitive.Messages, caught by the session:thread ErrorBoundary.

Root cause

assistant-ui renders messages/parts by numeric index. tapClientLookup throws when a render requests an index the just-shrunk keys array no longer has — a reconciliation race when the message/part list shrinks between renders (e.g. an SSE reconcile replacing a longer in-memory tree). The data itself is valid; the failure is structural in the library. The existing reload-based threadBoundaryRecovery looped because the same data re-triggered the throw.

Fix

Bump @assistant-ui/react 0.14.80.14.24 (16 patches behind). 0.14.24 reworks the grouped-parts renderer (MessageGroupedParts / buildGroupTree) which no longer throws on this race.

Verification

  • tsc -b clean
  • vitest 1322/1322
  • eslint clean
  • pnpm build + go build OK
## Problem Loading some sessions (e.g. `ses_0f4b12f21ffe3gZ97LqF9aNtyw`) crashed the thread with Safari's generic "The string did not match the expected pattern". The real error, logged via the client error forwarder, was: ``` tapClientLookup: Index 1 out of bounds (length: 1) tapClientLookup: Index 60 out of bounds (length: 33) ``` Thrown from `@assistant-ui/store`'s `tapClientLookup` during render of `ToolGroup → MessagePrimitive.Parts → ThreadPrimitive.Messages`, caught by the `session:thread` ErrorBoundary. ## Root cause assistant-ui renders messages/parts **by numeric index**. `tapClientLookup` throws when a render requests an index the just-shrunk keys array no longer has — a reconciliation race when the message/part list shrinks between renders (e.g. an SSE `reconcile` replacing a longer in-memory tree). The data itself is valid; the failure is structural in the library. The existing reload-based `threadBoundaryRecovery` looped because the same data re-triggered the throw. ## Fix Bump `@assistant-ui/react` `0.14.8` → `0.14.24` (16 patches behind). 0.14.24 reworks the grouped-parts renderer (`MessageGroupedParts` / `buildGroupTree`) which no longer throws on this race. ## Verification - `tsc -b` clean - `vitest` 1322/1322 - `eslint` clean - `pnpm build` + `go build` OK
fix(ui): bump @assistant-ui/react to 0.14.24 to fix thread render crash
All checks were successful
CI / Frontend (pull_request) Successful in 4m22s
CI / Backend (pull_request) Successful in 4m32s
CI / Build Desktop (macOS arm64) (pull_request) Successful in 37s
CI / Playwright E2E (pull_request) Successful in 7m47s
CI / Coverage Ratchet (pull_request) Successful in 5m44s
CI / Build (pull_request) Successful in 4m8s
CI / Semantic Tag (pull_request) Has been skipped
c2ac0eb920
Loading certain sessions threw 'tapClientLookup: Index N out of bounds'
from @assistant-ui's grouped-parts renderer when the message/part tree
shrank between renders, surfacing in Safari as 'The string did not match
the expected pattern'. The session:thread ErrorBoundary caught it but the
reload-based recovery looped because the same data re-triggered it.

0.14.24 reworks the grouped-parts renderer (MessageGroupedParts /
buildGroupTree), which no longer throws on this reconciliation race.

Coverage ratchet: pass

Suite Baseline This PR Δ
go 69.40% 69.40% +0.00
frontend 56.96% 56.96% +0.00

Tolerance: -0.1%. Baseline stored on gh-pages.

<!-- coverage-ratchet --> ### Coverage ratchet: ✅ pass | Suite | Baseline | This PR | Δ | | |---|---|---|---|---| | go | 69.40% | 69.40% | +0.00 | ✅ | | frontend | 56.96% | 56.96% | +0.00 | ✅ | _Tolerance: -0.1%. Baseline stored on `gh-pages`._
dries merged commit 3ae65a4384 into main 2026-06-28 23:02:17 +02:00
Sign in to join this conversation.
No description provided.