Skip to content

Fleet Studio B2b: wire the Enable-control act end-to-end + re-home it over the composer (#1551) - #1562

Open
jeonghun-jj-lee wants to merge 2 commits into
feature/free-tier-fleetfrom
opencode/fleet-enable-control-1551
Open

jeonghun-jj-lee wants to merge 2 commits into
feature/free-tier-fleetfrom
opencode/fleet-enable-control-1551

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Closes #1551. Base: feature/free-tier-fleet.

The last mile of B2b, surfaced by live verification after #1547 merged: on a self-owned remote peer-studio session, Enable control was a no-op and sat over the titlebar. This wires the act and re-homes the affordance.

What was broken

What this does

  • DEFECT 1 — wire the act (976b065). A payload-carrying fleet-enable-control bridge envelope ({ ownerMachineId, sessionID } — the bare command lane can't carry a target) → a new vscode-free handleEnableControlRequest (confirm-first) composing establishManagementVerified + enableSelfOwnedControl. Activation wires the ADR-0034-D4 native modal + the live fleet-peer provider / enroll-seeded authority / grant store. Grant persistence flips the projection: the next /amicode/fleet/sessions poll re-resolves amicode_control to interactive and lights the driving banner — the app never self-declares interactive (SoT stays the source).
  • DEFECT 2 — re-home over the composer (392fe7c). New SessionComposerControlScrim wraps the composer slot in session.tsx: while a remote peer session's control is not held, the composer is blurred + inert (non-editable) and a centered CTA ("This session lives on <peer> — Enable control to drive it") posts the DEFECT-1 envelope. Held/local → no scrim.

Invariants held

Gates (director-independent re-run on this branch)

  • Touched ext suites 221/221 (fleet_control_bootstrap 24, chat_bridge 66, sidebar_fleet_section 100, chat_panel 31).
  • Full ext suite: 12 fail / 4934 pass — all 12 environmental (11 macOS-loopback/SSH transport + cli_gate, which is a fresh-worktree staging artifact and passes 12/12 on the base checkout). Zero failures in any touched file; zero regressions.
  • Extension typecheck clean · additive-invariants (4/4 ADR-0027) · drift gate PASS (875 files) · overlay typecheck clean ×7 · app tests 37/37.

Deploy + verify (for JJ)

  1. Rebuild the app bundle + binary from this branch and restart VS Code (the enable path rides the app↔extension bridge, not a new HTTP route).
  2. Open "Free port 4096" → the composer is blurred with the CTA → click Enable control → native modal → confirm → the driving banner lights and the composer unblurs; a prompt then routes to the Studio.

amicode-ci added 2 commits September 25, 2026 09:37
…lope (#1551)

The self-owned enable path (evaluateControlBootstrap / enableSelfOwnedControl)
had ZERO live callers — the app posted the bare amicode.fleet.enableControl
command, which is not on the bridge allowlist and has no registered command, so
the envelope was dropped. Wire it as a PAYLOAD envelope (the bare command lane
cannot carry the target peer):

- app: postAmicodeFleetEnableControl posts { source, kind: fleet-enable-control,
  ownerMachineId, sessionID }.
- chat_bridge: BridgeIo.onFleetEnableControl + a shape-validated
  fleet-enable-control kind handler (NOT added to the command allowlist).
- fleet_control_bootstrap: handleEnableControlRequest — the live decision path
  (confirm-first native modal, then establishManagementVerified +
  enableSelfOwnedControl). Cancel / shared / unverified mint nothing.
- chat_panel: static onFleetEnableControl callback, threaded into the bridge IO,
  + fleet-enable-control added to both outer-relay inbound allowlists.
- extension: wire ChatPanel.onFleetEnableControl at activation to the live
  fleet-peer provider + enroll-seeded authority resolver + grant store, with the
  ADR 0034 D4 native-modal confirm. Grant persistence flips the projection on the
  next poll — the app never self-declares interactive.
…1551)

DEFECT 2 — the affordance rendered as a fixed top-right Portal over the
titlebar. Remove that placement and re-home it onto a composer-anchored scrim:

- session-header: remove the top-right fixed Portal + ENABLE_CONTROL_COMMAND;
  add SessionComposerControlScrim, which BLURS + gates (inert → non-editable)
  the composer and centers a 'This session lives on <peer> — Enable control to
  drive it' CTA when the current session is a REMOTE peer and control is NOT
  held. When control is held (interactive) or the session is local/unowned, the
  composer renders untouched (no scrim). The CTA posts DEFECT 1's payload
  envelope (postAmicodeFleetEnableControl).
- session-fleet-peers: findSessionOwnerInProjection — the scrim's source for the
  peer name (CTA copy) + owner machineId (envelope target).
- session.tsx: wrap the composer (PromptInputV2Composer / PromptInput) with the
  scrim.
- session-header.test: replace the top-right-Portal assertions with the
  composer-scrim + gated-composer assertions.

The sidebar-fleet #1544 AC5 regression guard stays green (no control markers
leak into the read-only sidebar).
@coderabbitai

coderabbitai Bot commented Sep 25, 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: 63cbefe2-0264-4ce0-a796-f0324f2f8749

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.

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