anomalyco / anomalyco/opencode

Web archive feature unreliable: SSE race + LIMIT bug closed as "not planned", community fix PRs auto-closed by bot

Open
#44,177 1 comment 1 reaction 1 assignee View on GitHub

@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:

  1. 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.
  2. Bulk archiving makes other sessions vanishSession.list() doesn't filter archived sessions server-side, so recently archived sessions (whose time_updated got bumped) consume the LIMIT window 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)

  1. opencode web, open a project with several sessions
  2. Click the archive button on a session → it briefly disappears, then reappears (~100ms)
  3. Refresh page → session is now actually archived
  4. 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.log if needed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.