feat(server): transport sandbox lifecycle hooks - #1589
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0ba38d997
ℹ️ 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".
|
|
||
| from pydantic import BaseModel, Field, RootModel, model_validator | ||
|
|
||
| OPEN_SANDBOX_LIFECYCLE_ENV = "OPEN_SANDBOX_LIFECYCLE" |
There was a problem hiding this comment.
Minor: consider aligning the name with the existing reserved env var convention and moving it where the other reserved env constants live.
- Naming: the other server-managed reserved vars use the
OPENSANDBOX_EGRESS_*prefix (no underscore betweenOPENandSANDBOX, e.g.OPENSANDBOX_EGRESS_MITMPROXY_SSL_INSECURE), so this would beOPENSANDBOX_LIFECYCLEfor consistency. - Placement: this is a runtime transport detail, not API schema — consider defining it alongside the other reserved env constants in
services/constants.pyand importing it here, so all reserved env names live in one place.
Note: renaming also requires syncing the execd side (ConfigEnv in components/execd/pkg/lifecycle/config.go plus the isolation/config.go, initmode_linux.go, and bootstrap.sh references), which is a cross-component change — fine to do as a follow-up if it needs to stay in this PR.
Summary
CreateSandboxRequest.lifecycleschema for the optionalpreStartandperiodichooks.OPEN_SANDBOX_LIFECYCLEenvironment variable for Kubernetes workloads so execd can consume it.This is the Server part of OSEP-0020 (#1542). It complements the execd implementation in #1587 and the API Spec/SDK changes in #1588. PATCH and other lifecycle hooks are intentionally out of scope.
Testing
Validated:
Breaking Changes
Checklist