Skip to content

Session archive on OpenCode 2.x servers #749

Closed

Description

@ivanfenenko

Why

Archiving works on OpenCode 1.x servers, but the app hides it on 2.x. Upstream restored v2 archiving (anomalyco/opencode#53759) and it shipped in v2.1.0 (openapi in #57260). The web app already uses it (packages/app/src/home/sessions/archive.ts). v2 users lost a feature they had on 1.x.

Current state (app main 7ad92e7)

  • supportsSessionArchive = false for v2 in ServerProtocol.kt / ServerProtocol.swift.
  • V2SessionRemote.archiveSession throws a local 404 (Android domain/session/V2SessionRemote.kt:64-67, iOS Domain/Session/V2SessionRemote.swift:72-73).
  • session.archived / session.unarchived are not handled.

Upstream API (v2.1.0)

  • PATCH /api/session/{id} body { "archived": true | false } (repeat is a no-op)
  • GET /api/session?archived=true|false (omit = both)
  • Session.time.archived (optional)
  • Events: session.archived, session.unarchived

App files

  • Android: domain/connection/ServerProtocol.kt, domain/session/V2SessionRemote.kt, data/remote/SessionsApi.kt, EventDomainAdapter.kt
  • iOS: Domain/Connection/ServerProtocol.swift, Domain/Session/V2SessionRemote.swift, Data/Remote/SessionsAPIClient.swift, UI/Main/Region/HomeSessionActions.swift, EventDomainAdapter.swift

Acceptance criteria

  • Archive / unarchive works on v2.1.0+ servers from the same actions as on 1.x
  • Home list requests archived=false; archived list (if shown) uses archived=true
  • session.archived / session.unarchived update lists live on both platforms
  • Older 2.x servers without the field keep the action hidden (no 404 surfaced)
  • Tests for v2 archive request and event handling

Activity

  1. added a commit that references this issue on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions