mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #300] [MERGED] fix(cli): tolerate BuildKit tunnel closure during publication #330
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#330
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/300
Author: @yingdi-shan
Created: 9/16/2026
Status: ✅ Merged
Merged: 9/17/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/cli-buildkit-publication-disconnect📝 Commits (1)
c7f5b3ffix(cli): tolerate BuildKit tunnel closure during publication📊 Changes
1 file changed (+47 additions, -2 deletions)
View changed files
📝
crates/aenv/src/client/buildkit.rs(+47 -2)📄 Description
What
Treat peer disconnect I/O errors as clean termination in the CLI's BuildKit bridge, and add a regression test using a real Unix socket with its peer's read side closed.
Why
An
aenv buildcan fail withBroken pipe (os error 32)even after the server has started publishing the template. The ensuing cleanup request then returns HTTP 409 because publication cannot be cancelled.If buildctl closes a socket while final status traffic is still arriving, a failed bridge write can terminate the tunnel before the CLI observes buildctl's successful exit. Finishing that connection cleanly lets the existing process-exit and template-status checks determine the build result.
Related issue
No linked issue; addresses the reported intermittent CI build failure.
Scope and non-goals
Limited to
crates/aenv/src/client/buildkit.rs: disconnect handling, an explanatory comment, and a socket regression test.Design and behavior changes
ready.Compatibility and operations
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Confirmed that
local_read_shutdown_does_not_fail_bridgefails withBroken pipe (os error 32)when the local write fix is temporarily removed, and passes with the fix restored.Skipped checks and reasons:
Risks and reviewer notes
Disconnects do not directly mark a build successful: buildctl's exit status and the server's terminal template status still determine success. The regression reproduces the socket failure locally; it does not reproduce the entire CI publication sequence.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.