Skip to content

feat(web): add session unarchive operation - #361

Closed
seekskyworld wants to merge 2 commits into
openpi-dev:mainfrom
seekskyworld:feat/issue-347-session-unarchive
Closed

feat(web): add session unarchive operation#361
seekskyworld wants to merge 2 commits into
openpi-dev:mainfrom
seekskyworld:feat/issue-347-session-unarchive

Conversation

@seekskyworld

Copy link
Copy Markdown
Contributor

Problem

Implements the reversible archive-management slice of #347. The Web API could archive sessions but offered no way to restore one.

Value

Archived Session metadata can be restored without deleting or rewriting the canonical Session file.

Approach

Add PiWebAdapter.unarchiveSession using the existing atomic archive metadata transaction and expose POST /api/sessions/unarchive. The operation validates the canonical Session through the same adapter boundary and emits a session_unarchived event.

Validation

  • npx tsc --noEmit
  • node --test --experimental-strip-types tests/web/web-host.test.ts tests/web/pi-adapter.test.ts (32 passed)
  • git diff --check

Impact

  • User-visible behavior: restores an archived Session through the API.
  • Model-visible context/tools: none.
  • Runtime/lifecycle: no Session replay or side effects.
  • Persisted config/data: updates existing archived-sessions.json atomically.
  • Compatibility/risk: archive view/UI action remains a follow-up; existing archive behavior is unchanged.

Signed-off-by: seekskyworld <djh1813553759@gmail.com>
Signed-off-by: seekskyworld <djh1813553759@gmail.com>

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head review: the unarchive operation is useful and no P2+ defect was confirmed in that slice. Focused adapter/host tests passed 32/32. An additional real-file probe verified concurrent/idempotent unarchive, unchanged canonical JSONL bytes/cwd, and restored state after adapter restart. However this PR also includes the entire older #360 trust projection, now overlapping main’s richer getProjectTrustStatus/trustInfo implementation. Recommendation: retain only the unarchive contribution with original author credit, preserve current main trust semantics, then validate the integrated result. Do not merge this full branch as-is; it also has current main conflicts. No source edits or merge performed.

tt-a1i added a commit that referenced this pull request Sep 7, 2026
…444)

Integrate Session-scoped terminal details from #389, Pi thinking reads from #375, and unarchive from #361 while preserving current trust diagnostics. Add authenticated endpoint and persistent unarchive integration tests.

Co-authored-by: testikun <320479488+testikun@users.noreply.github.com>
Co-authored-by: seekskyworld <djh1813553759@gmail.com>
@tt-a1i

tt-a1i commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

The useful unarchive implementation is integrated into main through #444 (1919542), with original contributor seekskyworld credited as a co-author. The inherited #360 trust projection was omitted because main already has the richer Pi-owned trust implementation. Added validation covers idempotency, restart, authentication and unchanged canonical Session bytes; full local tests and all CI passed. Closing this source PR as integrated.

@tt-a1i tt-a1i closed this Sep 7, 2026
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.

2 participants