Repository navigation
Description
Description
When running opencode web and accessing through a browser, after resetting a session (fork/restart) and sending a new message, the web UI frequently crashes with an unhandled error:
Error: Message not found: msg_f61ae7f9b001US1iJ2z3b3Btl5
at ixe (https://***/assets/index-ti7qIEGV.js:1009:58000)
at o (https://***/assets/index-ti7qIEGV.js:1009:7544)
at async Qi (https://***/assets/index-ti7qIEGV.js:1011:30116)
at async j (https://***/assets/index-ti7qIEGV.js:1014:30464)
at async ne (https://***/assets/index-ti7qIEGV.js:1014:33307)
────────────────────────────────────────
原因:
{
"body": {
"name": "NotFoundError",
"data": {
"message": "Message not found: msg_f61ae7f9b001US1iJ2z3b3Btl5"
}
},
"status": 404
}
Refreshing the page or clicking the "Restart" (重启) button temporarily fix it until another session switch or reset triggers it again.
Root cause: packages/app/src/context/server-session.ts — fetchMessage() (line 485) calls client.session.message({ sessionID, messageID }) and when the server returns 404 (stale message ID cached in React state after session reset), the error is thrown uncaught. The call site at line 641 (fetchMessage(sessionID, parentID, ...)) has no try/catch, so it propagates to the React error boundary, crashing the UI.
The underlying issue is that the web app's message cache (server-session.ts) is not invalidated when a session is reset/forked, leaving stale msg_xxx references in the parent message chain.
Plugins
oh-my-openagent@latest, @tarquinen/opencode-dcp@latest
OpenCode version
1.17.20
Steps to reproduce
- Start
opencode web --hostname 0.0.0.0 --port 4096 - Open the web UI in a browser (or via reverse proxy like nginx)
- Create a session and send a few messages
- Click the session reset button (重置会话)
- Type a new message and send it
- Switching to another session and switching back
- Observe: "Message not found: msg_xxx" error crashes the UI
- Refreshing the page or clicking the "Restart" button may temporarily fix it, but switching sessions triggers it again
Screenshot and/or share link
No response
Operating System
Ubuntu 22.04 (WSL2 on Windows)
Terminal
N/A (this is a web UI bug, reproduced via browser)
Activity
github-actions commentedon Jul 14, 2026
This issue might be a duplicate of existing issues. Please check:
Message not found#36256: SameMessage not found: msg_xxxerror in web mode after switching sessions/directories, identical error payload and stackparentIDpointing to a removed/stale message causes repeated 404s in the web UI, with detailed DB analysis and workaroundopencode-agent commentedon Jul 20, 2026
Fixed by #37918.