Skip to content

feat(sessions): archive and restore native conversations - #1406

Merged
pascalandr merged 2 commits into
devfrom
feat/native-session-archives
Nov 9, 2026
Merged

pascalandr merged 2 commits into
devfrom
feat/native-session-archives

Conversation

@pascalandr

Copy link
Copy Markdown
Contributor

Summary

Closes #929 and #1207 by using the native archive/restore API already present in OpenCode 2.2.3. The 2.2.6 run --archived announcement adds CLI convenience; no minimum or dependency bump is required.

  • Session row Archive session / Restore session actions and an Archived badge.
  • Search-local Unarchived sessions / Archived sessions / All sessions selector.
  • Hide idle archived branches in normal browsing and session-list cycling; preserve selected conversations and paths to running work or pending requests. Children retain independent native flags and remain independently searchable.
  • Serialize native writes, follow with ordinary authoritative inventory refresh and verify the flag. Failed/uncertain writes never synthesize local archive state or replay automatically.
  • Project archive events and fence older metadata reads; retain complete native inventory for ownership and recovery.
  • Technical docs and help in all ten locales; native minimum/latest coverage in CI.

Validation

  • Official isolated 2.2.6 and 2.2.3 CLI probes pass archive/restore, filtered cursor pagination, unfiltered listing, persisted flag, idempotent events, retained transcript and unchanged child flag, with no archive-induced model execution.
  • 132 targeted UI/store/recovery/pagination tests pass; 61 proxy ownership tests pass.
  • Workspace typechecks and 31 help tests pass.
  • Main real-browser archive/restore/search/failure journey passes, as do existing search and child-activity checks. Final compact-menu/delete reruns are in progress.
  • The repository fixture-wiring checker reports two pre-existing violations in unchanged WebKit automation tests (automation-webkit-geometry.test.ts, automation-webkit-page.test.ts); the new browser fixture uses the shared daemon and navigation budget.

Native probes use synthetic private databases and a local provider, never the shared daemon or user state. Large existing touched files: session-list.tsx (~1168 lines), session-events.ts (~732), session-state.ts (~1343).

Use OpenCode's existing archive API to keep completed conversations without deleting their history. Add row archive/restore actions and an Unarchived/Archived/All filter in session search, with native archived badges. Hide idle archived branches during ordinary browsing and keyboard cycling, while keeping selected conversations, running work and pending-question ancestor paths reachable. Child archive flags remain native and independent.

Serialize archive writes with session actions, refresh authoritative inventory and verify the returned flag. Preserve newer archive events against metadata reads started earlier. Retain complete inventory for ownership and recovery; never synthesize local archive state or replay uncertain writes. Runtime minimum and dependency pins stay unchanged.

Add native minimum/latest archive probes for persistence, filtered cursors, idempotent events, transcript preservation and unchanged children; store and real-browser coverage for actions, filtering, failures and stale reads. Update technical docs and user help in all ten locales. Focused UI regressions, proxy tests, typechecks and native 2.2.3/2.2.6 checks pass.
…tles

Use a naturally overflowing session title to exercise the compact menu and wait for measured row geometry before keyboard selection. Verify both archive and restore through native keyboard menu activation without forced pointer actions. Keep archive-tree activity checks explicit and calculate latest activity without spreading arbitrarily large child arrays.
@pascalandr

Copy link
Copy Markdown
Contributor Author

Gatekeeper review

Reviewed head: 721e6f8d2b99c7d92a761ed12c6a09f15bbe5374. Findings: 0.

Reviewed the existing generated client and proxy ownership path, mutation queue, native event projection, session metadata merge, normal hierarchy/list cycling, flat search and retained inventory. The archive state comes only from native time.archived; archive/restore writes receive authoritative refresh and flag verification. Refusal, silent unsupported writes and replaced connections cannot synthesize an archive flag. Metadata reads capture their baseline before I/O so newer archive events win.

Normal browsing hides idle archived branches, preserving the selected conversation and paths to running work or pending input. Child flags are not rewritten; flat search filters each session independently. Full inventory remains available for ownership, recovery, transcript reads and search. No data deletion, prompt, shared-service restart, minimum/pin change or local archive store is introduced.

Validation

  • Official isolated 2.2.6 and minimum 2.2.3: native archive/restore, persisted flag, filtered cursor pagination, unfiltered list, idempotent events, unchanged child flag and exact retained transcript all pass.
  • 132 targeted UI/store/recovery/pagination tests and 61 proxy tests pass. After the final explicit activity check/tree reduction, 20 focused tree/archive-store tests pass again.
  • Workspace typechecks pass; final UI typecheck passes.
  • Real browser: both archive journeys pass, including normal row actions, discovery, restoration, rejected writes, native events, selected-conversation retention and keyboard archive/restore through the compact menu. Existing search, descendant-activity and phone/narrow/desktop deletion journeys pass. Initial fixture attempts exposed a short title that did not overflow and an action attempted before measured compact layout settled; the final fixture uses a real long title and waits for the production geometry state, never forced clicks. An initial parallel phone-navigation timeout passed in the serial rerun.
  • 31 help checks pass, with strings and help updated in all ten locales. Workflow YAML parses and whitespace checks pass.

Existing repository failure retained

The fixture-wiring checker fails on two unchanged WebKit test files (automation-webkit-geometry.test.ts, automation-webkit-page.test.ts) missing exemption/budget declarations. The new archive fixture meets the shared-daemon/navigation-budget rules. This is recorded separately; the entire repository suite is not claimed green.

Large existing source files touched: packages/ui/src/components/session-list.tsx (~1168 lines), packages/ui/src/stores/session-events.ts (~732), packages/ui/src/stores/session-state.ts (~1343).

@pascalandr
pascalandr merged commit d999843 into dev Nov 9, 2026
2 checks passed
@pascalandr
pascalandr deleted the feat/native-session-archives branch November 9, 2026 00:04
@pascalandr

Copy link
Copy Markdown
Contributor Author

Full CI follow-up

Run 42538167720, attempt 1 finished red. Both native archive probes explicitly pass on OpenCode 2.2.3 and 2.2.6, and both archive browser journeys pass in shard 2, including keyboard compact-menu archive/restore.

All observed failures were inspected:

Failure Follow-up
Tauri Windows/macOS and three WebKit jobs: Cargo rejects the lockfile under --locked, before compilation #1407 repairs dangling windows-sys edges; its five affected native jobs already pass, PR still open
Main tests: binary-build-order contract omits tests-tauri-webkit from the expected prerequisites Correction is already included in #1305, still open
Browser 3: two Tauri settings-help assertions read the previous native opening receipt #1410 waits for the new receipt, still open
Browser 3: hidden Electron preview misses Key:a within 500 ms Matching fixture-readiness symptom is covered by #1345, whose browser shard 3 passed; this run's precise cause is not proven
Browser 4: two WebKit test wiring/budget declarations Already fixed in merged #1402

The failing files are unchanged between this PR's base and reviewed head. Its workflow diff only adds the archive native script and store test, without changing build prerequisites. The main tests job stops early, so later unit steps are not claimed to have passed CI. No observed failure implicates the archive paths, but the complete release candidate remains unqualified until integrated final-head CI and builds pass.

Existing fixes are being tracked rather than duplicated. No unchanged-head rerun or release publication was requested by this triage; #1395 remains draft with no auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sessions: adopt native session archiving once OpenCode exposes an archive API

1 participant