feat(fleet): desktop Fleet enrollment and live runner dashboard (RUN-8/RUN-9) - #280
Closed
KafuChino123 wants to merge 22 commits into
Closed
feat(fleet): desktop Fleet enrollment and live runner dashboard (RUN-8/RUN-9)#280KafuChino123 wants to merge 22 commits into
KafuChino123 wants to merge 22 commits into
Conversation
Add a FleetControlClient Swift package with generated protobuf and gRPC stubs for the fleet agent local control API. Wire the local package into the ArcBox app target so phase 1 desktop integration can import the generated client types.
Wrap the generated fleet control stubs in a high-level client for lifecycle, state watch, and settings RPCs. Map proto responses into desktop-facing models while preserving optional settings update presence semantics, and cover the mapping behavior with tests.
Add the local fleet control client to SwiftUI environment values and app scene injection. Start the fleet control transport outside daemon startup, log through the fleet category, and close it during app termination.
Drive fleet agent state from the local control watch stream. Add lifecycle actions, settings updates, reconnect backoff, and user-readable error handling for the runners dashboard.
Consume the signed-in OIDC session to list Platform workspaces and issue workspace-scoped Fleet enrollment tokens. Wire token issuance into local Fleet Agent enrollment and configure the Platform endpoint for app and CI builds.
Replace RUN-9 sample data and stub actions with FleetViewModel watch snapshots, workspace enrollment, and local drain/resume controls. Expose the runner section in release builds and cover the presentation-state mapping.
Let ArcBoxTests consume FleetControlClient through the hosted ArcBox target, avoiding Xcode’s duplicate dynamic gRPC package graph. Handle runner item-selection deep links explicitly so navigation remains exhaustive.
- coordinate authenticated token handoff with local Agent state - keep Fleet watch and client transport app-scoped - reconcile unknown outcomes and graceful termination
On macOS 26, any state change inside a fixedSize(vertical: true) subtree triggers a window-sizing pass that resizes the window — or the NavigationSplitView content when the window cannot grow — to the screen's visible-frame height, sliding the sidebar under the title bar and pushing the account button off-screen. Drop the modifier from the dynamic error label (it wraps identically without it) and document the pitfall in AGENTS.md.
Member
Author
|
Superseded by #281, which carries the same integration stack rebased onto master v1.23.2+ on the original feat/run-9-runner-section branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Turns the CI Runners section (RUN-9) into a live Fleet integration. Desktop now talks to the local
arcbox-fleet-agentover its Unix-socket control API, exchanges the signed-in OIDC session for a workspace-scoped enrollment token via the Platform REST API (RUN-8), hands that token to the Agent, and renders the Agent's live Watch stream — including the RUN-31 macOS VM backend state (agent update state, VM settings, runner-image preparation progress).Stacked as reviewable groups:
0ef52ed→c7a2a4b,e30cf62,88865f9) — generated from thearcboxmaster control proto; the exact source commit and sha256 are recorded inPackages/FleetControlClient/PROTO_SOURCE(currentlyarcbox@224eedbd, reproducible viagenerate.sh). Hand-written facade for lifecycle (Enroll/Drain/Resume/Unenroll), the Watch stream, settings with field-presence semantics, and the image-prepare stream.891bd7b,87e135a) — authenticated REST client (GET /v1/workspaces,POST /v1/fleet/enrollment-token) consumingAccessTokenProviding; enrollment tokens stay in memory only. The contract was taken from thearcboxlabs/platformhandler source and the liveopenapi.json, then confirmed with read-only probes against production.ec417a2,ccf6c85,116ee9b) —FleetEnrollmentCoordinatortreats Enroll as non-idempotent: baseline-snapshot gate before requesting a token, unknown-outcome reconciliation from the Watch stream, bounded attach timeout, app-scoped operation that survives window close, and a graceful settle pass on app termination.0378091/4cd5936— original commits by @AprilNEA, cherry-picked with authorship preserved — plus9fa0f9c,87f0db4,40f168b,893234f) — every UI state is explicit: connecting, agent-unavailable, signed-out, unenrolled onboarding with workspace picker, six enrollment-progress phases, three failure-recovery paths (retry / wait-for-agent / unenroll), and the live host view (status bar, in-flight jobs, image-prep progress).177d4e3,570ee15) — participation, load ceiling, memory floor, Docker mode, macOS VM mode, and runner image with readiness + preparation progress.Supersedes
origin/feat/run-9-runner-section(left untouched).Verification
arcbox-fleet-agentbuilt fromarcboxmaster (224eedbd) and installed via its owninstall-service: handshake, Watch stream, settings, and the unenrolled → UI state mapping all verified live.POST /v1/fleet/enrollment-tokenwas deliberately not exercised against production because it rotates the live workspace secret.Blockers / asks — input wanted
api.arcbox.devcurrently authenticates Better Auth session tokens; Desktop presents its OIDC access-token JWT. The API needs to accept the JWT (e.g. via JWKS verification) or define an exchange. Until then, sign-in works but Desktop cannot successfully callPOST /v1/fleet/enrollment-token. (Xuan — this is the RUN-8 auth contract question.)Enrollingadmission gate. Two concurrent Enroll calls can both reach gateway credential exchange; Desktop's Watch-based reconciliation only mitigates this. The real gate belongs in the Agent.AppDelegatestill callsdisableDaemon()when Desktop quits, which can pullarcbox-daemonout from under a Fleet VM job. A fix was drafted and intentionally shelved pending team discussion.FleetAgentConnectionmaintains the channel only). A clean machine currently has no bootstrap path — proposal: Platform-provided manifest (version/URL/SHA-256) + an owned installer story.Follow-ups (non-blocking)
FleetPlatformConfiguration(Bearer token transport).GET /v1/fleet/enrollment-token(status-only) for a "this will revoke the current token" confirmation before rotation.