anomalyco / anomalyco/opencode

server: pre-update sessions missing from session list after update to v2.0.5

Open
#49,412 1 comment 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Sep 16, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

After updating from V1 (1.18.x) to 2.0.5, sessions created while still on V1
no longer appear in the session list (web UI or GET /api/session). Only
sessions migrated during an earlier V2 beta trial plus newly created ones
are listed. The missing sessions still exist in the database.

Environment

  • opencode version: 2.0.5
  • OS: Linux 7.2.6-arch2-1 (linux x64)
  • Terminal: TERM=xterm-256color
  • Shell: /usr/bin/bash
  • Install/channel: latest
  • Active plugins: opencode-claude-auth@latest

Reproduction

  1. Have existing sessions from an older version in a project.
  2. Update to v2.0.5 and restart the server.
  3. List sessions: opencode api get "/api/session?directory=<project-dir>&order=desc&limit=100".
  4. Observe the list jumps from today's sessions straight back to sessions
    from over a month ago; everything in between is missing.

Expected Behavior

Previously created sessions remain listed after the update (per the V1→V2
migration guide, supported V1 behavior is intended to keep working).

Actual Behavior

The API serves rows from the session_v2 table, which is missing all
sessions written by V1 after a one-shot data migration ran during an
earlier V2 beta trial alongside V1. The beta shared the default data
directory (single opencode.db, OPENCODE_DB unset), so it recorded
migration.v1-v2 = {"phase":"completed"} in the same database V1 kept
using daily. After cutover, 2.0.5 treats the migration as done and serves
the stale snapshot: the missing sessions exist only in the legacy session
table, with full transcripts in message/part and zero rows in
session_message, invisible to all clients. No error is logged.

Additional Context

  • Consistent/reproducible across web UI and API, both filtered and unfiltered
    (session.list defaults to newest 50).
  • Server runs as opencode serve under systemd; same data directory before
    and after the update (OPENCODE_DB not set).
  • The migration guide advises keeping the V1 setup until V2 is confirmed,
    which makes this sequence (trial V2 → keep using V1 → cut over later)
    likely for other users too.

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.