Skip to content

feat(hub): widen the REST Box payload for native clients + start lifecycle verb#174

Merged
madarco merged 1 commit into
nightlyfrom
feat/hub-rest-box-payload
Jul 8, 2026
Merged

feat(hub): widen the REST Box payload for native clients + start lifecycle verb#174
madarco merged 1 commit into
nightlyfrom
feat/hub-rest-box-payload

Conversation

@madarco

@madarco madarco commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • GET /api/v1/boxes now carries the raw host-side fields — state, name, projectRoot, projectIndex, vncEnabled, gitWorktrees, per-agent session titles, and claudeActivity/codexActivity — so native clients (the tray app) can rely on REST instead of shelling agentbox list -g --json.
  • Synthetic creating/error job boxes now carry name/projectRoot too, and deliberately no state: its absence is how a client tells a failed create from a real running box whose agent errored.
  • New POST /api/v1/boxes/{id}/start lifecycle 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.
  • OpenAPI spec updated (including the previously-missing displayName/webUrl/vncUrl), plus apps/web API 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

  • Widened payload + worktrees/titles on real docker + hetzner boxes.
  • stop → start → start (no-op) → pause → start (resumes) cycle green via curl.
  • Bogus action 400 lists start; job: id 409s.
  • Fired a create: synthetic row shows status:creating, name/provider/projectRoot, no state.

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/boxes so native clients (the macOS tray) can use the hub REST API instead of agentbox list -g --json. Real boxes now include optional raw host fields — state, name, projectRoot, projectIndex, vncEnabled, gitWorktrees, per-agent session titles, and claudeActivity/codexActivity — mapped in hub-backend.ts from ListedBox. Synthetic creating/error job rows gain name and projectRoot but omit state so clients can tell a failed create from a running box whose agent errored.

Adds POST /boxes/{id}/start: validates via LIFECYCLE_ACTIONS, implements HubBackend.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, and CLAUDE.md document the wider Box schema and tray’s hub-first integration.

Reviewed by Cursor Bugbot for commit 950ed85. Configure here.

…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
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentbox-web Ready Ready Preview, Comment Jul 8, 2026 11:13am

Request Review

@madarco madarco merged commit 57ccc64 into nightly Jul 8, 2026
4 checks passed
@madarco madarco deleted the feat/hub-rest-box-payload branch July 8, 2026 11:59
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