mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #427] [CLOSED] feat(custom-extension): include sandbox metadata in lifecycle hooks #429
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#429
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/427
Author: @guozy18
Created: 10/23/2026
Status: ❌ Closed
Base:
main← Head:sync/custom-extension-user-metadata📝 Commits (1)
8cdee8bfeat(custom extension): send user metadata📊 Changes
21 files changed (+159 additions, -9 deletions)
View changed files
📝
docs/src/concepts/custom-extension/lifecycle-hooks.md(+4 -2)📝
src/custom_extension_api/generated/docs/PatchCustomExtensionParamsHookRequest.md(+1 -0)📝
src/custom_extension_api/generated/docs/StartFreshHookRequest.md(+1 -0)📝
src/custom_extension_api/generated/docs/StartResumeHookRequest.md(+1 -0)📝
src/custom_extension_api/generated/src/models/patch_custom_extension_params_hook_request.rs(+8 -1)📝
src/custom_extension_api/generated/src/models/start_fresh_hook_request.rs(+4 -0)📝
src/custom_extension_api/generated/src/models/start_resume_hook_request.rs(+4 -0)📝
src/custom_extension_api/openapi.yml(+16 -0)📝
src/orchestrator/launch_plan.rs(+4 -0)📝
src/orchestrator/persistence/file_backed.rs(+1 -0)📝
src/orchestrator/service.rs(+5 -1)📝
src/orchestrator/tests.rs(+1 -0)📝
src/sandbox/backend.rs(+1 -0)📝
src/sandbox/custom_extension/client.rs(+43 -3)📝
src/sandbox/firecracker/config.rs(+5 -0)📝
src/sandbox/firecracker/factory.rs(+6 -2)📝
src/sandbox/firecracker/sandbox.rs(+47 -0)📝
src/sandbox/mock.rs(+1 -0)📝
src/sandbox/mod.rs(+3 -0)📝
tests/integration/posix_startup_pack.rs(+1 -0)...and 1 more files
📄 Description
What
Include the sandbox's user metadata in
start-fresh,start-resumeandpatch-paramshook requests. Extensions can use the same metadata available in the sandbox API without a separate lookup.Why
Hooks currently receive extension parameters and runtime identity but omit the create request's metadata. For example, if a snapshot was captured from a sandbox tagged
team=alpha, a new sandbox created withteam=betamust sendbetato its hooks. If the new request omits metadata, the hooks must not receivealphafrom snapshot provenance.Related issue
No linked issue. This draft adds optional context to the existing hook protocol.
Scope and non-goals
Hook request metadata, launch/resume propagation, generated bindings and lifecycle documentation. Existing hook failure statuses and resource cleanup remain in place.
Design and behavior changes
SnapshotSource::Sandbox.source_sandbox_metadataremains informational provenance and does not control launches. This differs fromcustomExtensionParams, which can be inherited from a snapshot when no launch override is supplied.SandboxLaunchConfig->FirecrackerCommonConfig-> hook payload. It uses the existing Firecracker config rather than depending on the internal shared-backend extraction or another open PR.volumeMounts, including an empty array.Compatibility and operations
metadatato three extension hook requests; OpenAPI bindings regenerated.metadata.SandboxBackendFactory::build_from_paused_statenow receives user metadata.Validation
make custom-extension-clientcargo fmt --all -- --checkcargo clippy --locked --workspace --all-targets --all-features -- -D warningsValidation used this PR alone on upstream
9f62cbe, with all 829 tracked files checked against the tested source tree. It did not use fork/main or #428. The additional VM check reused the exact previously built #427 binary, whose hash was verified.Generated tracked files match the regeneration output. Existing HTTP hook serialization/status tests and launch-provenance tests are included. Full OSS/P2P and unrelated suites were not run.
GitHub
unit-testsis currently blocked before running tests bytikv-jemalloc-sys: inheritedMAKEFLAGS=" -- PROFILE=debug -j ..."makes its nested make treat-jas a target. The identical failure is present on the unchanged upstream baseline and in this PR's job. The direct Cargo and isolated runtime results above are separate evidence, not a claim that all GitHub checks pass.Risks and reviewer notes
Extensions receive operator-visible sandbox metadata in addition to extension parameters. Review the launch-only behavior for snapshots and record-based restore for legacy paused state.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.