feat(hub): widen the REST Box payload for native clients + start lifecycle verb#174
Merged
Conversation
…cycle verb GET /api/v1/boxes now carries the raw host-side fields (state, name, provider, projectRoot, projectIndex, vncEnabled, gitWorktrees, per-agent session titles, agent activity) so native clients (the tray app) can rely on REST instead of shelling 'agentbox list'. Synthetic creating/error job boxes carry name/provider/projectRoot too, and deliberately no 'state' - its absence is how a client tells a failed create from a real box whose agent errored. POST /boxes/:id/start brings a stopped box back up (resumes when paused, no-op when running). Claude-Session: https://claude.ai/code/session_01JKGc7YWFuXVJvXKNHYnHeB
|
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 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
GET /api/v1/boxesnow carries the raw host-side fields —state,name,projectRoot,projectIndex,vncEnabled,gitWorktrees, per-agent session titles, andclaudeActivity/codexActivity— so native clients (the tray app) can rely on REST instead of shellingagentbox list -g --json.creating/errorjob boxes now carryname/projectRoottoo, and deliberately nostate: its absence is how a client tells a failed create from a real running box whose agent errored.POST /api/v1/boxes/{id}/startlifecycle verb: brings a stopped box back up, resumes when paused, no-op when running. It does not restore agent tmux sessions (that stays CLI-only); the agent restarts on next attach.displayName/webUrl/vncUrl), plusapps/webAPI docs, hub README, and the CLAUDE.md tray section.All new Box fields are optional, so the hosted/Postgres source keeps compiling and simply omits them.
projectRoot(an absolute host path) is only emitted by the in-process host backend.Verified live
stop → start → start (no-op) → pause → start (resumes)cycle green via curl.start;job:id 409s.status:creating,name/provider/projectRoot, nostate.Companion change: the agentbox-tray app migrates to this API (separate repo, shows building/failed boxes with actions disabled).
https://claude.ai/code/session_01JKGc7YWFuXVJvXKNHYnHeB
Note
Medium Risk
Adds a public lifecycle verb and enlarges the Box JSON contract; behavior touches provider start/resume paths on the host backend, though changes are additive and hosted sources can omit new fields.
Overview
Expands
GET /api/v1/boxesso native clients (the macOS tray) can use the hub REST API instead ofagentbox list -g --json. Real boxes now include optional raw host fields —state,name,projectRoot,projectIndex,vncEnabled,gitWorktrees, per-agent session titles, andclaudeActivity/codexActivity— mapped inhub-backend.tsfromListedBox. Syntheticcreating/errorjob rows gainnameandprojectRootbut omitstateso clients can tell a failed create from a running box whose agent errored.Adds
POST /boxes/{id}/start: validates viaLIFECYCLE_ACTIONS, implementsHubBackend.start(probe → resume if paused, else start; no-op when running; refreshes SSH config; does not restore agent tmux sessions like the CLI). OpenAPI,api.mdx, hub README, andCLAUDE.mddocument the wider Box schema and tray’s hub-first integration.Reviewed by Cursor Bugbot for commit 950ed85. Configure here.