mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #321] [MERGED] feat(templates): add E2B-compatible build status and logs #345
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#345
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/321
Author: @zlzGithub-0801
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/29/2026
Merged by: @yingdi-shan
Base:
main← Head:feat/template-status-logs📝 Commits (1)
b5be3b9feat(templates): add E2B-compatible build status and logs📊 Changes
33 files changed (+2587 additions, -239 deletions)
View changed files
📝
crates/aenv/src/client/templates.rs(+11 -1)📝
crates/aenv/src/commands/pull.rs(+22 -1)📝
crates/aenv/src/commands/template.rs(+146 -46)📝
crates/aenv/src/progress.rs(+18 -3)📝
services/gateway/internal/server.go(+26 -6)📝
services/gateway/internal/server_test.go(+45 -0)📝
src/api/generated/src/apis/templates.rs(+31 -0)📝
src/api/generated/src/models.rs(+266 -1)📝
src/api/generated/src/server/mod.rs(+203 -4)📝
src/api/impls/image_build.rs(+14 -3)📝
src/api/impls/image_build/tests.rs(+255 -1)📝
src/api/impls/image_build/worker.rs(+4 -1)📝
src/api/impls/mod.rs(+2 -0)📝
src/api/impls/template.rs(+386 -143)📝
src/api/openapi.yml(+113 -1)📝
src/image/build_history.proto(+29 -0)📝
src/image/buildkit/history.rs(+247 -5)📝
src/logging.rs(+13 -5)📝
src/sandbox/process.rs(+35 -1)📝
src/sandbox/ublk/device.rs(+1 -1)...and 13 more files
📄 Description
What
Add E2B-compatible template build status and logs APIs, persistent build-log storage, and CLI build progress output.
Why
Template builds previously exposed limited status information and no structured logs. Users could not inspect build progress or diagnose failures through the API and CLI.
Related issue
#5
Scope and non-goals
This PR includes template build log collection, storage, API querying, internal build-node routing, and CLI output.
It does not change unrelated sandbox logging or retain completed build logs in memory.
Design and behavior changes
Log collection and storage
Template build logs are collected from three sources:
Active logs are buffered in memory and periodically persisted to:
The final logs are flushed when the build finishes, after which the in-memory buffer is removed.
Status and logs APIs
The status endpoint returns build state together with paginated log entries. The logs endpoint supports cursor pagination, direction, level filtering, and log source selection.
temporaryreads the active build’s in-memory buffer.persistentreads the shared repository file.Build requests are routed internally to the build node without requiring clients to provide an additional routing header.
aenvCLIaenv pullandaenv template watchnow poll the status API with an incrementallogsOffsetand print new build logs while waiting.The CLI displays
info,warn, anderrorentries while filtering outdebugentries. Detached pulls retain the existing behavior and return immediately without streaming logs.Compatibility and operations
snapshots/build-logs/{buildID}.json.Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetRisks and reviewer notes
BuildKit Status streams may replay events after reconnects, so vertex states and output entries are deduplicated.
Active builds use in-memory logs for low-latency reads. Completed builds rely on shared repository storage, so the final flush must complete before the buffer is removed.
The main review areas are:
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.