feat(hub): custody-backed 'Carried into boxes' + fold box-image into the Docker row - #278
Merged
Merged
Conversation
…trol box Two System-page fixes for the remote hub: - "Carried from this machine" is meaningless on a deployed control box, where homedir() is the VPS's. When custody is enabled the section retitles to "Carried into boxes" and answers "what will a box created here actually get?": the per-agent credentials held in custody (count / size / last update) beside the skills the control box itself carries, with a link to /custody. On a plain localhost hub it keeps today's behaviour and title. The Custody page's not-enabled empty state now links back to /system, so the two point at each other in whichever mode applies. Implemented as a second client-side fetch of /api/v1/custody (pure REST client — no new server plumbing, seams intact). - The docker-only "Box image" section (registry / pull tag / stamped fingerprint / local image ref) folds into the Docker row of the Providers section; the standalone section is removed. Only the docker row gets these fields. Adds summarizeAgentCredentials() to custody-view (pure, unit-tested). Claude-Session: https://claude.ai/code/session_019M5TG6UdiUN2PfYUBcLruY
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Implements two items from
docs/remote-hub-backlog.mdfor the remote hub's System page.Item A — "Carried from this machine" makes no sense on a remote hub
On a deployed/exposed control box,
homedir()is the VPS's home, so the old section listed ~1 path and told the operator nothing about what a hub-created box actually receives. The real answer there lives in custody.agentsscope (entry counts / sizes / last update) under an Agent credentials · custody subheading, alongside the still-valid host-carried skills the control box itself carries, with a link across to /custody.Done as a second client-side fetch of
/api/v1/custody(the hub web layer is a pure REST client — no new server plumbing, route seams untouched). New pure helpersummarizeAgentCredentials()incustody-view.ts(reusesgroupCustody; unit-tested).Item B — the "Box image" section was docker-only
The box-image fields (registry / pull tag / stamped fingerprint / local image ref) now fold into the Docker row of the Providers section; the standalone "Box image" section is deleted. Only the docker row gets them. Data source unchanged (
/api/v1/systemboxImage).Verification
pnpm --filter @agentbox/hub lint,typecheck, andtestall green (79 tests, incl. newsummarizeAgentCredentialscases).Smoke-tested both modes against the standalone build in this box (rebuilt + restarted per CLAUDE.md), rendered with a headless browser.
Localhost mode —
/api/v1/custody→{"enabled":false}; System page keeps "Carried from this machine", box-image fields fold into the Docker row, Custody page links to /system:System page rendered text (docker row):
Custody page (localhost):
Custody isn't enabled on this hub. … keeps credentials on your machine directly — see Carried from this machine(link → /system).Exposed/control-box mode — ran the standalone hub with an admin token so custody turns on (
hub setupneeds aghcredential this box lacks; custody-enabled mode is driven purely by the admin token, so the direct run exercises the identical/api/v1/custody enabled:true→ UI code path), seeded fake custody entries under~/.agentbox/hub/custody:System page rendered text:
Teardown: killed the direct hub, removed the seeded custody + test
control-plane.env, restarted the plain localhost hub (custody back toenabled:false). Box left clean.Docs
Updated
apps/web/content/docs/deployed-hub.mdx(the Custody / System & Build descriptions) to reflect the cross-links and the "Carried into boxes" behaviour. The/systemAPI response shape is unchanged, soapi.mdxstays accurate.https://claude.ai/code/session_019M5TG6UdiUN2PfYUBcLruY
Note
Low Risk
Dashboard-only UI and read-only REST clients; no API shape changes or credential exposure beyond existing metadata-only custody listings.
Overview
System & Build now distinguishes localhost hubs from deployed control boxes for what gets shown as “carried” into new boxes. It loads
/api/v1/custody(alongside the existing system fetch) and waits on that before picking a mode so the UI doesn’t flash the wrong framing.When custody is disabled, behavior is unchanged: “Carried from this machine” lists host paths from
hostCarried. When custody is enabled, the section becomes “Carried into boxes” with a per-agent credential rollup (counts, sizes, last update via newsummarizeAgentCredentials()incustody-view.ts), skills-only rows from the control box host, and links to /custody.The standalone Box image block is removed; registry, pull tag, fingerprint, and local image ref render inside the Docker provider row only (
BoxImageDetail).Custody’s disabled empty state links to /system (“Carried from this machine”). Docs in
deployed-hub.mdxdescribe the cross-links and the two carried modes.Reviewed by Cursor Bugbot for commit bfdce68. Configure here.