Repository navigation
Record allocation phase time and document per-provider sandbox fields - #123
Merged
Merged
Conversation
…tained limit equal to its active limit
- Migration 000072 adds runtime_allocations.compute_phase_changed_at (NULL for
existing rows, clock_timestamp() for new ones). SetRuntimeCompute moves it only
when the phase actually changes.
- GET /core/v1/sandbox/nodes/{node_id}/allocations returns
compute_phase_changed_at (nullable) per item; the management OpenAPI and the
SandboxAllocation client type include it.
- Docker never suspends, so a Docker node's max_retained always equals its
max_active. Enrollment tokens and node PATCH replace any submitted value inside
the deployment transaction before validating; the node list reports it that
way. Provider-independent limits are still rejected before the transaction.
- Capacity tests: the approved-capacity test now runs on microsandbox, which uses
both limits; TestDockerRetainedLimitFollowsActive covers Docker, and
TestRuntimeComputePhaseChangedAt covers the phase time.
- Documentation describes the new field and the Docker retained limit.
…ck capacity before deployment state - Node identity, node configuration (token and node credential) and enrollment apply the Docker rule, so a token or node stored before it existed also reports and stores max_retained equal to max_active. - CreateRuntimeEnrollment normalizes and validates capacity before the mode/maintenance conflict check, so invalid capacity is still a 400. - compute_phase_changed_at is described as null when unknown; an allocation that existed before Core recorded it reports null until its next phase change. - Tests: Docker reads with legacy 2/8 token and node rows; microsandbox PATCH with max_retained below max_active is rejected and writes nothing; invalid capacity under maintenance is invalid input; the node allocation list returns the phase time and null for a NULL column.
Add a table to the deployment contract covering E2B, Docker and microsandbox: deployment specification, template build, suspension and resource counts; enrollment limits; node counts, diagnostics and host disk; allocation phases; runtime observation CPU, memory, disk and sleeping state; and runtime history CPU. Link it from the Hosted Sandbox Manager guide.
000073 from #118 is already on main. Numbering this branch's migration after it lets databases that applied 000073 upgrade without goose's out-of-order migration error. No test or document references the version.
This was referenced Sep 25, 2026
SaladDay
added a commit
that referenced
this pull request
Sep 25, 2026
…125) Keep #124's Core-key sign-in, fixed console actor label and configuration names; the console still forwards every signed-in /core/v1 request by the prefix rule instead of the removed allowlists. Installer, console tests and docs take #124's wording with /core/v1 paths in place of /core/v1/admin. #123's allocation test uses automatic placement, since P4 removed explicit node selection.
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.
This completes the consolidated sandbox API request: allocation phase time, the Docker retained-limit semantics, and one documented per-provider field table.
Change
GET /core/v1/sandbox/nodes/{node_id}/allocationsitems gaincompute_phase_changed_at: when the allocation entered its currentcompute_phase.000074adds the column. Existing rows stay null until their next phase change; no values are invented.SetRuntimeComputeupdates the time only when the phase actually changes.000073, so databases that already applied000073upgrade without an out-of-order error.max_retainedalways equalsmax_active.contracts/agents-api/sandbox-deployment.md, "What each field means per sandbox provider", covers E2B, Docker and microsandbox. It includes the deployment specification and runtime,e2b.template_build,suspension, allocations/pending, enrollment tokens, nodes, diagnostics, host disk, allocation phases, observation cpu/memory/disk,sleeping, and history CPU. Every cell was checked against the code.packages/agents-clienttypes updated. The public/v1OpenAPI is unchanged. Thedocs/web/protocol-coverage.mdwording for the Docker retained limit is corrected.Validation
000073to000074; API tests; 612 client tests;pnpm typecheck.make check(server mode) passed on7dd3bafd. Playwright browser cases were skipped on the server (Chrome unavailable; user-approved skip).Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.