mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #395] [MERGED] feat(custom-extension): surface hook 4xx/5xx status to API callers #401
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#401
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/395
Author: @guozy18
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @yingdi-shan
Base:
main← Head:sync/extension-status-errors📝 Commits (1)
879dc5ffeat(custom-extension): surface hook 4xx/5xx status to API callers📊 Changes
4 files changed (+256 additions, -12 deletions)
View changed files
📝
docs/src/concepts/custom-extension/lifecycle-hooks.md(+6 -0)📝
src/api/impls/sandbox.rs(+142 -6)📝
src/sandbox/custom_extension/client.rs(+107 -6)📝
src/sandbox/custom_extension/mod.rs(+1 -0)📄 Description
What
Preserve custom-extension HTTP failures and distinguish caller rejection from extension server errors.
Why
An extension 4xx rejection was reported as a server error on launch/resume paths, while a patch hook 5xx could be reported as a client error.
Related issue
N/A — focused synchronization of an existing implementation.
Scope and non-goals
Typed hook errors, API error classification, original regression tests, one main-branch fork-result regression, and lifecycle documentation.
Design and behavior changes
Map hook 4xx to 400 for create/cold-create/connect/fork/patch, and to 409 on resume. Map hook 5xx to server errors. Keep main-branch volume rollback before returning. Classify per-child fork results as well as whole-operation errors; v2 wrappers reuse the existing mappings. Preserve best-effort stop behavior.
Compatibility and operations
Validation
Validated on upstream main
949cec2plus this single commit, independently of the other synchronization PRs.Clippy and all 18 focused tests ran on Linux as a non-root user. Full workspace tests and VM lifecycle E2E were not rerun for this PR.
Risks and reviewer notes
Clients may observe 4xx instead of 500. Extension error bodies become visible to API callers. The retained tests exercise hook 4xx/5xx responses, nested error propagation and per-child fork-result classification. Full VM lifecycle E2E was not rerun for this PR.
The original author, author date and commit message are preserved. Main-branch adaptations are described above.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.