Repository navigation
Add standalone, reusable Environments - #932
Merged
Merged
Conversation
A pending reset lists hosted Environments with no attached Session after the Sessions page and expires them through the cleanup path, so the reset completes. Document the unattached lifetime with and without checkpoints, and drop the ledger lines for the key limit, Template retry and reset gap.
Re-read the attachment after the Environment lock, start the idle clock at detach, release failed unattached compute, reject unknown members beside environment_id, scope creation keys to the Project and creator (migration 000015), admit attach against the deployment state, list reset Environments with a cursor, fail retained-history mismatches fast, keep a standalone placement on Session deletion, validate Automation targets for existence only, and share one public-address classifier.
…ach in lock order
…used Harness step
…nvironment on deletion
…e size of standalone Environments
This comment has been minimized.
This comment has been minimized.
…label and name the idle setter after its field
…lock at readiness and list reset candidates in one order
…creation only for the lease owner, scope the list cursor to its creator and check the attach exclusions against the pin
…he cleanup request Replace about twenty per-path predicates with the environment_liveness view (ended, active), rename Allocation.Reclaimed to Ended, and drop the per-trigger releases the model makes redundant.
The placement reservation step releases every placement held without compute by an Environment that can no longer run work. Detach, archive and reset no longer release placements themselves, and a failure before allocation is covered.
SaladDay
marked this pull request as ready for review
November 6, 2026 10:15
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
Standalone, reusable Environments in the public Agents API. One Session attaches at a time, in sequence.
POST /agents/environments:Idempotency-Keytakes 1–256 bytes; an empty key returns 400. A retry with the same key and body returns the same Environment, even after its named Template was deleted. A different body returns 409.vault_idsreturns 400.GET /agents/environmentsreturns the Project's standalone Environments with the official pagination.ready.POST /agents/sessionswithenvironment.environment_id:notconstraint applies, and so does thex_agents_core.environmentrejection.pendingEnvironment is allowed.model_provider_unreachable(a recorded gap).endedandactive, theenvironment_livenessview, read by every query that reclaims or admits;Allocation.Ended, placements through one sweep before reservation, workspaces through the deletion sweep;idle_secondsis one top-level/core/v1deployment setting for every Provider. With checkpoints an unattached Environment suspends after it and expires at the end of retention; without checkpoints it expires after it.environment_id.Docs are in EN and zh:
environments.md(new section "Standalone Environments"),index.mdledger,wire-semantics.md,environment-files.md,sandbox-deployment.mdandpublic-agent-api.md, which gains a prewarm example.Checks
go vet ./...,scripts/check-sqlc.py,make openapi(no diff),pnpm --dir website check-translationsandpnpm --dir website testpass.api,sessions,deployment,deploymentpg,sessionpg,executionandtests/integration, including the official-SDK scenario (official_environments.py), concurrent attaches and creates, and the reset of an unattached Environment. The lifecycle tests fail when their rule is removed.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.