openwork icon indicating copy to clipboard operation
openwork copied to clipboard

[Bug]: v2 migration preserves archived sessions but v2 cannot unarchive, locking them read-only

Open brunotorresdigital opened this issue 1 month ago • 1 comments

Summary

After the automatic v1 -> v2 engine upgrade, sessions that were archived in v1 are imported into v2 with their time.archived timestamp preserved, but archive/unarchive is intentionally disabled on v2 (per #4587). The result is a one-way state: those sessions render as read-only with the "Restore it to continue" banner, and there is no way to restore them — not from the sidebar (only Pin is offered), not from the command palette, and not through the API.

So this is not only a missing control for new sessions: it is an irreversible lockout of existing history, applied silently to every install that had archived sessions when the forced upgrade ran.

To Reproduce

  1. With OpenWork Desktop on the v1 engine, archive some sessions and confirm they land in the "Archived" section.
  2. Upgrade to OpenWork 0.18.60 and let the background engine upgrade move the install to OpenCode v2 (opencode2 2.0.26).
  3. Open one of the previously archived sessions: it renders read-only — "This conversation is read-only. Restore it to continue; previous work will not restart."
  4. Try to restore it. The banner's Restore button cannot succeed (the v2 session client rejects time.archived writes with UnsupportedInV2Preview); hovering the sidebar row or opening its context menu offers only Pin; the command palette shows archive/unarchive disabled with "Archiving and unarchiving are not available in the OpenCode v2 preview."

Expected behavior

Two acceptable outcomes, in order of preference:

  1. Full parity: archive/unarchive works on v2, so migrated sessions stay organized and can be brought back when needed.
  2. No irreversible migration: while the v2 primitive does not exist, the upgrade should not carry time.archived into v2 — import archived sessions as active, or offer a one-time "restore all archived sessions" during the upgrade. If restore is impossible, the read-only banner should not instruct the user to restore.

Actual behavior

  • The archived flag is preserved in the v2 database (session_v2.time_archived) and the app honors it (time.archived > 0 means archived and read-only).
  • The mutation is unavailable: PATCH /api/session/{id} on the v2 engine accepts a title, and any time.archived write is rejected with UnsupportedInV2Preview (501). The native contract exposes Session.Info.time.archived but no archive mutation — which is exactly why #4587 disabled the controls.
  • Net effect: every session archived before the upgrade becomes permanently read-only in v2. Sidebar groups can organize new work but cannot release these sessions.

Desktop info

  • OpenWork version: 0.18.60
  • Engine: OpenCode v2 preview (opencode2 2.0.26)
  • OS: Windows 11

Additional context

  • I understand and agree with the reasoning in #4587 (no deleting sessions, no invented local archive persistence). The gap is that migration now forces that state onto v2 while the engine cannot undo it, and the upgrade is no longer optional — see #6350.
  • If the engine side is the real blocker, is there an upstream issue/PR in anomalyco/opencode to track for the archive mutation? Knowing where parity will come from would help everyone following this.
  • Same upgrade wave, different symptoms: #5877 (session list unavailable after migration) and #5539 (app-configured providers ignored on v2).

brunotorresdigital avatar Oct 22 '26 17:10 brunotorresdigital

Fixed in #6664: archived v1 chats are copied as active and existing ones open normally on v2.

OmarMcAdam avatar Oct 29 '26 00:10 OmarMcAdam