anomalyco / anomalyco/opencode
Web archive feature unreliable: SSE race + LIMIT bug closed as "not planned", community fix PRs auto-closed by bot
@Hona is already working on this.
Since Aug 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
Archiving sessions in the Web UI is unreliable, and every path to a fix has been shut down:
- Archive "flashes back" — clicking archive sometimes looks like it failed: the session disappears from the sidebar, then reappears ~100ms later due to an SSE race condition (#7882). The archive actually succeeded server-side; refresh shows it gone.
- Bulk archiving makes other sessions vanish —
Session.list()doesn't filter archived sessions server-side, so recently archived sessions (whosetime_updatedgot bumped) consume theLIMITwindow and unarchived sessions silently drop off the sidebar until a page refresh (#24850).
Both issues were closed as "not planned" despite clear root-cause analysis.
Repro (v1.18.21, latest)
opencode web, open a project with several sessions- Click the archive button on a session → it briefly disappears, then reappears (~100ms)
- Refresh page → session is now actually archived
- Batch-archive 10+ old sessions in a project with many sessions → some previously visible unarchived sessions disappear from the sidebar until refresh
Verify actual DB state:
sqlite3 ~/.local/share/opencode/opencode.db \
"SELECT id, title FROM session WHERE time_archived IS NOT NULL"
The frustrating part
A working fix exists: PR #24907 (fix(session): exclude archived sessions from Session.list() query) added the missing isNull(time_archived) condition matching listGlobal()'s behavior, plus tests — all passing. Instead of being reviewed, it was auto-closed by automated-pr-cleanup (>1 month old, <2 reactions). Follow-up attempts (#26868, #27034) were also closed.
So the current state for users is:
- Data integrity is fine (archive writes succeed), but the UX is broken in both directions (looks like it failed / unrelated sessions disappear)
- No upgrade path fixes it — v1.18.21 still affected
- Every community fix attempt dies in automation
Request
Please reopen and review #24907 (or land the equivalent one-line server-side filter + the SSE event ordering fix from #7882). This is a small, well-understood fix that would resolve a long-standing daily annoyance.
- Version: opencode 1.18.21 (latest)
- Platform: Linux x64
- Logs available at
~/.local/share/opencode/log/opencode.logif needed
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.