Repository navigation
Description
Summary
On OpenCode Desktop 2.2.6 (Windows), the renderer throws a fatal error and the app must be restarted:
Error: Expected a user-message timeline row
The error comes from packages/session-ui/src/timeline/session-timeline-row.tsx. It appears to happen when a virtualized timeline row changes type under an existing row key, and a cleanup path re-reads the reactive row accessor after the type changed.
Environment
- opencode version: 2.2.6 (Desktop, bundled CLI 2.2.6;
opencode2.1.4 is also on PATH) - OS: Windows 11 Home 10.0.26200 (build 26200), 64-bit
- Terminal: Desktop app (no terminal)
- Shell: PowerShell 5.1 / cmd
- Install/channel: packaged desktop app (
ai.opencode.desktop), latest; updater reports 2.2.6 is the latest version - Active plugins:
opencode-goal-plugin@0.11.0,superpowers@git+https://github.com/obra/superpowers.git,@bybrawe/opencode-loop@0.6.9,@bybrawe/opencode-goal@1.3.49. Probably unrelated: the crash is in core session UI code.
Reproduction
Intermittent; observed once. The affected session was long-running (~3.8k stored messages, 15 compactions) and was streaming when the crash happened. The exact UI action at that moment is unknown, but the crash occurred during a timeline update.
Likely steps:
- Open a long session in Desktop.
- While the timeline is virtualized, cause a row key to disappear or change type under an existing virtual item: send a message, undo/remove a message, let auto-compaction land, or load older history.
- The renderer throws and the app shows the fatal error screen.
Expected Behavior
The timeline re-renders the new row set without a fatal error. At most, a row should be replaced or briefly show a placeholder.
Actual Behavior
Fatal renderer error in the desktop log:
[2026-11-09 02:01:28.316] [error] (renderer) fatal renderer error {
error: 'Error: Expected a user-message timeline row\n' +
' at t (oc://renderer/assets/route-n9fMH66W.js:24:60066)\n' +
' at get row (oc://renderer/assets/route-n9fMH66W.js:24:60362)\n' +
' at oc://renderer/assets/route-n9fMH66W.js:24:52896\n' +
' at Array.<anonymous> (oc://renderer/assets/route-n9fMH66W.js:24:67875)\n' +
' at nt (oc://renderer/assets/main-PFC26dD0.js:2:13277)\n' +
' at nt (oc://renderer/assets/main-PFC26dD0.js:2:13190)\n' +
' at nt (oc://renderer/assets/main-PFC26dD0.js:2:13190)\n' +
' at nt (oc://renderer/assets/main-PFC26dD0.js:2:13190)\n' +
' at oc://renderer/assets/main-PFC26dD0.js:2:3079\n' +
' at P (oc://renderer/assets/main-PFC26dD0.js:2:6603)\n' +
' at Array.<anonymous> (oc://renderer/assets/main-PFC26dD0.js:2:3073)\n' +
' at oc://renderer/assets/main-PFC26dD0.js:2:15846\n' +
' at P (oc://renderer/assets/main-PFC26dD0.js:2:6652)\n' +
' at Object.fn (oc://renderer/assets/main-PFC26dD0.js:2:15266)\n' +
' at Ke (oc://renderer/assets/main-PFC26dD0.js:2:9618)\n' +
' at Ge (oc://renderer/assets/main-PFC26dD0.js:2:9389)\n' +
' at Je (oc://renderer/assets/main-PFC26dD0.js:2:11030)\n' +
' at Ze (oc://renderer/assets/main-PFC26dD0.js:2:11907)\n' +
' at Xe (oc://renderer/assets/main-PFC26dD0.js:2:11304)\n' +
' at Ye (oc://renderer/assets/main-PFC26dD0.js:2:11211)\n' +
' at Je (oc://renderer/assets/main-PFC26dD0.js:2:11088)\n' +
' at Ze (oc://renderer/assets/main-PFC26dD0.js:2:11907)\n' +
' at Xe (oc://renderer/assets/main-PFC26dD0.js:2:11304)\n' +
' at Ye (oc://renderer/assets/main-PFC26dD0.js:2:11211)\n' +
' at we (oc://renderer/assets/main-PFC26dD0.js:2:6555)\n' +
' at oc://renderer/assets/main-PFC26dD0.js:698:112100\n' +
' at i (oc://renderer/assets/esm-rub_JZLD.js:15:6665)',
url: 'oc://renderer/index.html',
version: '2.2.6',
platform: 'desktop',
os: 'windows'
}
The app restarted about 8 seconds later. No data loss was observed; the session continued on the server.
Additional Context
Root-cause analysis against the v2.2.6 source (the file is unchanged on dev as of this report):
-
packages/app/src/session/timeline/virtualizer.tsx(VirtualRow, around line 1059):const row = createMemo(() => rowByKey().get(rowProps.rowKey) ?? rows()[item().index] ?? initialRow)
When a keyed row disappears or the map shifts, this falls back to the row at the virtual item's index. That row can have a different
_tagthaninitialRow, even though the component still holds the old key. -
packages/session-ui/src/timeline/session-timeline-row.tsx(render, around line 1070):const current = () => { const value = row() if (!Predicate.isTagged(value, "UserMessage")) throw new Error("Expected a user-message timeline row") return value }
Rowdispatches once via<Show when={TimelineRow.key(props.row())} keyed>, but branch helpers such ascurrent()re-read the reactiverow(). If the row type changes during an update, a cleanup path (for examplegrowIn'sonCleanup->grown(props.row.userMessageID)inFrame) evaluatesprops.rowafterrow()has already fallen back to the index row. The guard throws, and Solid's error boundary treats it as fatal. -
Suggested minimal fix: do not fall back to
rows()[item().index]for a keyed virtual row. Use the keyed row or the capturedinitialRow, and skip syntheticremoved:*keys. Alternatively, make each branch'scurrent()helper non-throwing by returning the last same-tag row. A regression test should replace aUserMessagerow with a non-user row at the same virtual index while the row is mounted.
No existing issue was found for this error string. The crash is intermittent; the full renderer log can be provided if useful.
Activity
bermuda99 commentedon Nov 9, 2026
totally not created with ai
opencodejr commentedon Nov 9, 2026
Thanks for the detailed analysis. I could reproduce this crash.
The desktop app doesn't run in our sandbox, so I reproduced it with a component test. It renders the real session-ui timeline row renderer, compiled with Solid's compiler, and gives the row the same accessor
VirtualRowuses (rowByKey().get(key) ?? rows()[index] ?? initialRow):<Show>inRowdisposes the old branch.growIn'sonCleanupcallsgrown(props.row.userMessageID), which re-reads the row accessor, andcurrent()throwsError: Expected a user-message timeline row. The stack matches your log.It fails the same way on v2.2.6 and on the latest
dev(6973d89). The script below reproduces it (runbun installin an opencode checkout first).Reproduction script (repro.sh)
Run it:
bash repro.shjimmyallinai commentedon Nov 9, 2026
I'll take a look at this. My plan: reproduce the crash with the component test from the bot's comment (the
VirtualRowrow-accessor shape), then fix the stale re-read so a row whose key disappeared can't throwExpected a user-message timeline rowfrom a cleanup path after its type changed, and verify with that reproduction test plus the neighbouring session-ui timeline tests and typecheck.fix(session-ui): prevent fatal row-type mismatch when virtualized tim…