mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #56] [MERGED] fix(proxy): isolate connections across runtime generations #143
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#143
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/56
Author: @MasakiMu319
Created: 7/29/2026
Status: ✅ Merged
Merged: 7/29/2026
Merged by: @LSX-s-Software
Base:
main← Head:fix/proxy-runtime-generation-connection-reuse📝 Commits (2)
14ac34efix(proxy): isolate connections across runtime generations9a3bae2test(proxy): clarify runtime generation simulation📊 Changes
1 file changed (+108 additions, -1 deletions)
View changed files
📝
src/api/proxy.rs(+108 -1)📄 Description
Problem
Sandbox interaction IPs are recycled when runtimes stop, while envd always listens on the same port. The process-wide Hyper client pools idle connections by URI authority (
IP:port), which does not encode the sandbox runtime generation.This allows the following sequence:
client error (SendRequest); the proxy returns 502.Retrying automatically is unsafe because proxied ConnectRPC requests can have side effects.
Fix
pool_max_idle_per_host(0).Active requests and streaming connections are unchanged; only reuse after a connection becomes idle is disabled.
Validation
The regression test was run against the current
mainbefore the production change and failed with:After the fix:
cargo test -p agentenv --lib api::proxy::tests— 32 passedcargo clippy -p agentenv --all-targets -- -D warningscargo fmt --all -- --checkA same-host lifecycle probe reproduced 15 initial proxy failures in 200 cycles before the fix and 0 in 1,200 cycles afterward, with no retries. Median latency remained effectively unchanged:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.