Skip to content

Fleet Studio: remote (peer-owned) session archiving parity — archived list, read-only flip, real-time #1647

Open

Description

@jeonghun-jj-lee

Summary

In the peer-studios fleet topology (each machine runs its own engine + DB and observes peers via fan-out), archiving a remote (peer-owned) session does not behave like archiving a local one. The archive write already routes to the owner (observation write plane), but the archive list is local-only, so a remote-archived session vanishes: it leaves the active list (correct) but never appears in the local Archive list.

Root cause

  • buildFleetProjection (packages/extension/src/amicode_service/merged_projection.ts:417) fetches "/experimental/session?limit=10000" with no archived param — the fleet projection is active-only.
  • The archived tab (home.tsx:350, session-header.tsx:1113) calls experimental.session.list({archived:true}), a path-less request that the multiplexer (session_multiplexer.ts:497-511) routes to the local engine only.
  • archived appears nowhere in packages/extension/src/amicode_service/.
  • Deliberate acknowledgement of the gap: session-header.tsx:1172-1177.
  • Write-routing dependency: unarchive/delete resolve the owner from the owner map (OwnerMapFeed, active-only), so archived-session ids aren't resolvable.

Acceptance criteria

  1. List parity — archiving a peer-owned session from the list makes it appear in the local machine's Archive list, tagged with the owner machine.
  2. Read-only flip — archiving from the chat archive affordance flips the viewed session to read-only in place.
  3. Real-time — the change reflects on both machines within ~1-2s (active list drop + archive-list appearance + composer flip).
  4. Unarchive/delete of a remote archived row route to the owner (control-gated), with fail-closed lock chip when control isn't held.
  5. Standalone (non-fleet) behavior is byte-identical to today.
  6. Green: pnpm --filter amicode test, pnpm test:engine, boot smoke.

Slices (TDD-ready)

  • S1: buildFleetProjection archived option + /amicode/fleet/sessions?archived=true.
  • S2: owner map includes archived sessions (write-routing).
  • S3: app archived-tab fleet fetch + standalone fallback.
  • S4: archived-row rendering parity (owner badge + control-gated actions).
  • S5: chat-menu archive polish (control-aware + session's own directory).
  • S6: real-time archived list (SSE-driven refresh).

Part of the peer-fleet feature (PR #1407, branch feature/free-tier-fleet).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uibugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions