feat(fleets): FleetSandboxService lifecycle backend (OSEP-0007 Phase 1a, T3) - #1571
Open
Pangjiping wants to merge 2 commits into
Open
feat(fleets): FleetSandboxService lifecycle backend (OSEP-0007 Phase 1a, T3)#1571Pangjiping wants to merge 2 commits into
Pangjiping wants to merge 2 commits into
Conversation
…ase 1a, T3) - FleetSandboxService(SandboxService, ExtensionService): create/get/list/ delete/renew-expiration/patch-metadata/diagnostics against FastPath v2; pause/resume/logs/get_endpoint return clear unsupported errors (phase 1a) - idempotent Create with pool-profile validation and bounded DataPlaneReady wait; ambiguous post-persistence failures recover by Get and return accepted Pending - list exhausts FastPath continue-token pages, applies state/metadata filters, then computes OpenSandbox page/total/hasNextPage semantics - Delete preflights Get to preserve the public 404 contract - ExtensionService reads renew-on-access from the reserved renew-extend-seconds metadata key - FastPathClient switched to a synchronous gRPC channel: lifecycle methods run in FastAPI thread-pool handlers and asyncio.to_thread renew workers, where an aio channel bound to another loop would be unsafe - FleetsRuntimeConfig + RuntimeConfig.type=fleets + AppConfig.fleets; snapshot factory maps fleets to NoopSnapshotRuntime; factory registers the new service; fleets error codes added
Pangjiping
requested review from
Generalwin,
hittyt,
jwx0925 and
ninan-nn
as code owners
August 19, 2026 04:04
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1502b31109
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- lazy-connect FastPathClient on first use so production lifecycle calls work without an explicit connect() hook - offload the synchronous create workflow (pool lookup + Create + DataPlaneReady wait) to asyncio.to_thread so the event loop stays responsive during bounded readiness waits - enforce server.max_sandbox_timeout_seconds via ensure_timeout_within_limit before mapping the create request - hide fleets-reserved metadata keys from the create response, matching get/list behavior - resolve the tenant namespace for background lookups (renew workers, proxy) by scanning the injected tenant provider before falling back to the global namespace, mirroring the Kubernetes backend - tests: lazy connect, reserved-key hiding, max timeout, tenant fallback
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
Work item T3 of OSEP-0007, Phase 1a: the
FleetSandboxServicelifecycle backend on top of the fast-sandbox FastPath v2 gRPC API (prereqs: #1558 client, #1559 mapping).Changes
FleetSandboxService(SandboxService, ExtensionService)— full lifecycle surface against FastPath v2:create_sandbox: simplified Create (mapping + pool-profile validation), boundedDataPlaneReadywait, accepted-Pending recovery on ambiguous post-persistence failuresget_sandbox/list_sandboxes(exhaust continue tokens → state/metadata filter → OpenSandbox page/total semantics) /delete_sandbox(404-preflight, async finalizer) /renew_expiration/patch_sandbox_metadata(RFC 7396, reserved-key protection)GetSandboxDiagnostics;pause/resume/logs/get_endpointreturn clear unsupported errors (phase 1a)ExtensionService.get_access_renew_extend_secondsreads the reservedrenew-extend-secondsmetadata keyasyncio.to_threadrenew workers, where an aio channel bound to another event loop would be unsafe (matches Docker/K8s sync-call pattern)FleetsRuntimeConfig,runtime.type = "fleets",AppConfig.fleets, factory registration, snapshot factory →NoopSnapshotRuntime, fleets error codesNotes
get_endpointremains unsupported until T6 (stable tenant-scoped gateway route); the ingress contract work is tracked in fleets (OSEP-0007) Phase 1a T5: extend ingress provider/proxy contract and add fleets provider #1566codes.NotFoundto 404Verification
uv run pytest tests/test_fleets_service.py tests/test_fleets_mapping.py tests/test_fleets_fastpath_client.py tests/test_config.py tests/test_snapshot_runtime_factory.py tests/test_runtime_resolver.py— 185 passeduv run ruff check— clean