mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #350] [CLOSED] feat: add webhook API #370
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#370
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/350
Author: @zlzGithub-0801
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:feat/webhook📝 Commits (1)
9ab1d30feat: add webhook API📊 Changes
27 files changed (+7736 additions, -34 deletions)
View changed files
📝
docs/src/SUMMARY.md(+1 -0)➕
docs/src/concepts/sandboxes/webhooks.md(+178 -0)📝
services/README.md(+2 -0)📝
services/gateway/internal/cluster_list.go(+366 -0)📝
services/gateway/internal/cluster_list_test.go(+362 -0)📝
services/gateway/internal/metrics.go(+11 -0)📝
services/gateway/internal/server.go(+5 -0)📝
src/api/generated/src/apis/mod.rs(+1 -0)➕
src/api/generated/src/apis/webhooks.rs(+203 -0)📝
src/api/generated/src/models.rs(+2331 -0)📝
src/api/generated/src/server/mod.rs(+1183 -0)📝
src/api/impls/mod.rs(+9 -0)➕
src/api/impls/webhooks.rs(+555 -0)📝
src/api/openapi.yml(+556 -0)📝
src/api/server.rs(+1 -0)📝
src/bin/server.rs(+20 -10)📝
src/lib.rs(+1 -0)📝
src/orchestrator/service.rs(+15 -23)📝
src/orchestrator/tests.rs(+53 -0)📝
src/orchestrator/types.rs(+6 -1)...and 7 more files
📄 Description
What
Adds E2B-compatible lifecycle event webhooks, implemented natively in the node:
GET/POST /events/webhooks,GET/PATCH/DELETE /events/webhooks/{webhookID},GET /events/webhooks/{webhookID}/deliveries,GET /events/webhooks/{webhookID}/statsPOSTdelivery of sandbox lifecycle events (created,killed,paused,resumed,forked) to every enabled, subscribed webhookdeliveriesandstatsacross all nodesWhy
Webhooks are not im
Related issue
#5
Scope and non-goals
aggregation of
deliveriesandstats.updatedandcheckpointedevents (registering themreturns
400),event_data.executionandkill_reason, the/events/sandboxes*query API, durable delivery, and multi-tenancy.Design and behavior changes
webhooks/{id}.jsonin the snapshot repository (POSIX or OSS), so nodes thatshare a repository share registrations. Every change also updates
webhooks/generation. Nodes check this marker before each event and reloadwhen it changes, 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.to
$AENV_HOME/webhooks/deliveriesand pruned hourly after 7 days. Through thegateway,
deliveriesandstatsare sent to every node and the results aremerged. If any node fails, the request returns
502.Compatibility and operations
webhookstag, with E2B schemas.
/statsadditionally returns400whenstart >= endorthe range exceeds 31 days. The scheduler proto is unchanged: Update/Checkpoint
events never existed in it, and webhook-only data is not reported.
webhooks/{id}.jsonandwebhooks/generationValidation
make fmtmake clippymake test-unit:make -C services test, plusmake -C services fmt-check vetmaketarget(
make agentenv-server)docs/src/concepts/sandboxes/webhooks.md,services/README.md)Risks and reviewer notes
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.