mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #356] feat: add webhook API #375
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#375
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/356
Author: @zlzGithub-0801
Created: 10/10/2026
Status: 🔄 Open
Base:
main← Head:feat/webhook-limit📝 Commits (1)
042d0e3feat: add webhook API📊 Changes
30 files changed (+2706 additions, -29 deletions)
View changed files
📝
Cargo.lock(+2 -0)📝
docs/src/concepts/custom-extension/connect-and-use.md(+93 -0)📝
docs/src/concepts/custom-extension/index.md(+1 -1)📝
docs/src/concepts/custom-extension/lifecycle-hooks.md(+22 -3)📝
src/api/generated/src/apis/mod.rs(+1 -0)➕
src/api/generated/src/apis/webhooks.rs(+95 -0)📝
src/api/generated/src/models.rs(+461 -0)📝
src/api/generated/src/server/mod.rs(+487 -0)📝
src/api/impls/mod.rs(+9 -0)➕
src/api/impls/webhooks.rs(+231 -0)📝
src/api/openapi.yml(+152 -0)📝
src/api/server.rs(+1 -0)📝
src/bin/server.rs(+8 -0)📝
src/custom_extension_api/generated/Cargo.toml(+2 -0)📝
src/custom_extension_api/generated/README.md(+3 -0)📝
src/custom_extension_api/generated/docs/DefaultApi.md(+35 -0)➕
src/custom_extension_api/generated/docs/SandboxEventData.md(+12 -0)➕
src/custom_extension_api/generated/docs/SandboxEventHookRequest.md(+22 -0)📝
src/custom_extension_api/generated/src/apis/default_api.rs(+63 -0)📝
src/custom_extension_api/generated/src/models/mod.rs(+4 -0)...and 10 more files
📄 Description
What
Adds an E2B-compatible lifecycle event webhook, backed by the custom extension:
GET /events/webhooks,GET/PATCH /events/webhooks/{webhookID}POST {url}/sandbox-hook/event, that receives sandboxlifecycle events (
created,killed,paused,resumed,forked) as signedE2B v2
SandboxEvents while the webhook is enabledWhy
Webhooks are not implemented in AgentENV, so clients built on E2B's webhook API
cannot use it. This version reuses the custom extension: AgentENV forwards events
to the extension, and the extension decides how to fan them out.
Related issue
#5
Scope and non-goals
sandbox-hook/eventextension hook.deliveriesandstats,delivery retries, E2B's
updatedandcheckpointedevents (setting themreturns
400),event_data.executionandkill_reason, the/events/sandboxes*query API, and multi-tenancy.Design and behavior changes
webhook. Its settings (
name,events,enabled,signatureSecret) arestored as
webhooks/extension.jsonin the snapshot repository (POSIX or OSS).Its URL is not stored: it is always
{url}/sandbox-hook/eventfrom[custom_extension].url, and setting it returns400. Nodes read the file onevery event, so a change made on any node applies to the next event on every
node.
orchestrator lifecycle broadcast and support
created,killed,paused,resumed, andforked.forkedis an AgentENV extension and carriessource_sandbox_id. Each node delivers only events for its own sandboxes.and best-effort: one attempt per event, failures are only logged, and the
sandbox operation is never blocked or failed. Requests are signed only when a
signatureSecretis set. No delivery history is kept.Compatibility and operations
webhookstag, with E2B schemas. The extension API gains the optionalsandbox-hook/eventhook. The scheduler proto is unchanged.[custom_extension].urlis set, and it is disabled until enabled through PATCH.webhooks/extension.json.Validation
make fmtmake clippymake test-unitmaketarget(
make agentenv-server,make custom-extension-client)docs/src/concepts/custom-extension/)Risks and reviewer notes
signatureSecretis stored in plaintext in the repository.unavailable extension.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.