Skip to content

Fleet Studio #1525 (B1, read-only): peer sessions appear in the titlebar dropdown - #1536

Merged
jeonghun-jj-lee merged 1 commit into
feature/free-tier-fleetfrom
opencode/fleet-studio-1525-b1-dropdown-merge
Sep 24, 2026
Merged

jeonghun-jj-lee merged 1 commit into
feature/free-tier-fleetfrom
opencode/fleet-studio-1525-b1-dropdown-merge

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Part of #1525 (B1 — read-only half). Base: feature/free-tier-fleet. Depends functionally on #1524 (PR #1535).

What & why

The titlebar Sessions dropdown never showed peer sessions because SessionChatsDropdown (session-header.tsx) builds its list purely from local project stores + the local archived list — it never fetched /amicode/fleet/sessions and never read amicode_owner. (The machine-filter helpers lived only in session-chats-dropdown.test.ts, wired to nothing.)

B1 makes peer sessions appear — badged, searchable, de-duped — with no destructive control. Owner-routed open and remote prompt/archive/delete (+ the evaluateRemoteWriteGate confirm) are B2, left in #1525 for design sign-off.

Change

  • New pure module session-fleet-peers.ts (unit-tested, 9 cases):
    • peerSessionsFromProjection — tolerant reader (404/error/malformed → []), keeps only is_local:false entries, coerces to the SDK Session shape + owner overlay.
    • mergePeerSessions — dedupe by id (local wins), sort by last activity.
    • deriveSessionBadge / isRemotePeerSession.
  • SessionChatsDropdown: fetch /amicode/fleet/sessions while the flyout is open (tolerant createResource), merge peers into the active list, render the owner badge (monitor icon, matching the provenance header), and
    • guard openSession — a remote row does not do a broken local navigate; it surfaces "lives on <machine>".
    • hide the local archive action on remote rows.

Safety / degradation

  • No projection route (404) or no fleet → the dropdown is the local list, exactly as before. No throw, no blank.
  • Read-only: adds no control authority over a peer's sessions.

Gates

  • Session-component unit tests 62/62 (incl. the new module 9/9 + the existing dropdown/provenance tests — no regression)
  • Overlay typecheck clean across all 7 packages (app/ui/session-ui/core/schema/sdk/llm)
  • Full app unit suite: 12 failures, all pre-existing happydom-environment flakes in unrelated modules (observe-element-offset, prompt-input editor, session relay routes, icon theme bridge, postAmicode bridge). Proven unrelated: nothing outside session-header.tsx imports the changed subtree.

ACs (of #1525)

  • AC1 remote peer sessions appear, badged ✓
  • AC2 projection 404/empty → local list unchanged ✓
  • AC3 search matches merged peer sessions ✓ (existing search runs over the merged list)
  • AC4 owner-routed open · AC5 control + confirm gate · AC6 retire orphaned test helpers → B2 (deferred, need design sign-off).

…ebar dropdown

The titlebar Sessions dropdown (SessionChatsDropdown) built its list purely
from local project stores + the local archived list — it never fetched
/amicode/fleet/sessions and never read amicode_owner, so a peer's session could
not appear there by construction. (The machine-filter helpers existed only in
session-chats-dropdown.test.ts, wired to nothing.)

B1 is the READ-ONLY half of #1525: peer sessions APPEAR in the dropdown, badged
with the owner machine name, searchable, de-duped against local. Owner-routed
open + remote control (prompt/archive/delete + the evaluateRemoteWriteGate
confirm) are B2 and deliberately absent.

- New pure module session-fleet-peers.ts: peerSessionsFromProjection (tolerant —
  404/error/malformed → [], keeps only is_local:false entries),
  mergePeerSessions (dedupe, local wins, sort by last activity), deriveSessionBadge,
  isRemotePeerSession. Unit-tested (9 cases, bun:test).
- SessionChatsDropdown: fetch /amicode/fleet/sessions while the flyout is open
  (tolerant createResource), merge peers into the active list, render the owner
  badge (monitor icon, matching the provenance header), and:
  * guard openSession — a remote row does NOT do a broken local navigate; it
    surfaces "lives on <machine>" (owner-routed open is B2).
  * hide the local archive action on remote rows (B2).

Degrades cleanly: no projection route (404) / no fleet → the dropdown is the
local list exactly as before. Depends functionally on #1524 (the route must
mount to have data), but is safe to merge independently.

Gates: session-component unit tests 62/62; new module 9/9; overlay typecheck
clean across all 7 packages (app/ui/session-ui/core/schema/sdk/llm). The 12
full-app-suite failures are pre-existing happydom-environment flakes in
unrelated modules (observe-element-offset, prompt-input editor, session relay
routes, icon theme bridge, postAmicode bridge) — none import this subtree.

AC1/AC2/AC3 (appear/degrade/search) covered; AC4 (owner-routed open) + AC5
(control + confirm gate) + AC6 (retire the orphaned test helpers) are B2.
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 1816b186-0fe3-483e-b22a-341f8a92b631

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review September 24, 2026 13:31
@jeonghun-jj-lee
jeonghun-jj-lee merged commit e687e1b into feature/free-tier-fleet Sep 24, 2026
12 checks passed
@jeonghun-jj-lee
jeonghun-jj-lee deleted the opencode/fleet-studio-1525-b1-dropdown-merge branch September 24, 2026 13:32
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.

1 participant