Skip to content

Commit 9e208c8

Browse files
authored
feat: add workspace runtime adapter (#320)
* feat: add workspace runtime adapter * fix: clean canceled lease reservations * fix: harden Hetzner workspace readiness * fix: paginate Hetzner SSH keys * fix: bound workspace recovery accounting * fix: cap workspace recovery at hard TTL * fix: align workspace TTL with recovery windows * fix: preserve lease cleanup across workspace retention * fix: preserve workspace readiness intent
1 parent a0a4e37 commit 9e208c8

9 files changed

Lines changed: 3966 additions & 88 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Added
66

7+
- Added an idempotent workspace adapter over coordinator leases, with durable owner-scoped lifecycle mapping and truthful capability negotiation for external control planes.
78
- Added a generated provider decision matrix with checked metadata for execution model, access, substrate, GPU fit, lifecycle, cleanup, and provider caveats; docs validation now fails on provider drift. Thanks @coygeek.
89
- Added confirmed lifecycle actions to portal lease rows, with provider shutdown for coordinator-managed boxes and explicitly metadata-only deregistration for client-managed boxes.
910
- Added `provider: superserve` for delegated Linux sandbox runs through the Superserve control and data planes, including archive sync, retained leases, ownership-guarded lifecycle operations, and credentialed live smoke coverage. Thanks @coygeek.

docs/operations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ CRABBOX_HOST_ID optional; pins a brokered host such as an EC2
198198
CRABBOX_AWS_MAC_HOST_ID optional legacy AWS alias for CRABBOX_HOST_ID
199199
CRABBOX_SHARED_OWNER optional fixed owner identity for shared-token automation
200200
CRABBOX_ADMIN_TOKEN required for admin routes and image promotion
201+
CRABBOX_WORKSPACE_SSH_PUBLIC_KEY required for /v1/workspaces lease provisioning
202+
CRABBOX_WORKSPACE_PROVIDER optional workspace provider; currently hetzner only
203+
CRABBOX_WORKSPACE_CLASS optional workspace machine class; default standard
201204
CRABBOX_GITHUB_CLIENT_ID required for browser login
202205
CRABBOX_GITHUB_CLIENT_SECRET required for browser login
203206
CRABBOX_SESSION_SECRET required for browser login
@@ -232,6 +235,11 @@ CRABBOX_AWS_ORPHAN_SWEEP_GRACE_SECONDS optional; default 900
232235
CRABBOX_AWS_MAC_HOST_SWEEP_RELEASE optional; set 1 to release stale pending EC2 Mac hosts during orphan sweep
233236
```
234237

238+
Workspace leases currently use their hard TTL for provider expiry because the
239+
adapter does not yet receive a trustworthy activity signal. Workspace TTLs must
240+
be at least 1,800 seconds so a durable claim and ambiguity-recovery window both
241+
fit before hard TTL.
242+
235243
### Artifact backend
236244

237245
The artifact backend vars are ordinary coordinator settings except

worker/src/coordinator-runtime.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export function coordinatorRequestQueue(request: Request): CoordinatorRequestQue
1717
if (method === "POST" && path.join("/") === "v1/leases") {
1818
return "direct";
1919
}
20+
if (path[0] === "v1" && path[1] === "workspaces") {
21+
return "direct";
22+
}
2023
if (method === "POST" && path.join("/") === "v1/internal/scheduled") {
2124
return "direct";
2225
}

0 commit comments

Comments
 (0)