mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[GH-ISSUE #204] Cache sandbox-to-node routing in the AENV gateway #66
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#66
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?
Originally created by @yingdi-shan on GitHub (Aug 22, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/204
Affected component
Gateway / scheduler
Problem statement
The gateway calls the scheduler
LookupNodeRPC for every request containing a sandbox ID. This adds scheduler load and latency.Use case
Large scale deployments handling frequent data-plane and control-plane requests for long-lived sandboxes. The same sandbox may receive many requests through different gateway replicas, while deletes and node changes may be handled by any replica.
Current behavior and workarounds
Every sandbox-routed request performs a scheduler lookup. There is no gateway cache. The scheduler has no explicit binding-delete RPC, and
ReportSandboxEventcurrently logs delete events without mutating the binding store. A local-only delete eviction would therefore leave other gateways with stale entries until their process restarts or a scheduler binding expires.Desired behavior
NotFoundand scheduler errors must not be negative-cached.NotFound, return 404. If it returns a new node, retry once only for a replay-safe request.Proposed approach
Add a bounded process-local cache in the gateway. Query the configured scheduler on cache misses, and populate or refresh entries after successful
LookupNodecalls and successful create or fork assignment recording.Compatibility and operational impact
API/config changes:
No client-facing API change is required.
Snapshot or storage format changes:
None.
New host/runtime requirements:
None. The cache is in process memory.
Alternatives considered
Pre-submission checklist
@DAOZHENREN commented on GitHub (Aug 22, 2026):
Hi, I'd like to work on this issue.
My proposed implementation plan is:
keyed by sandbox ID and storing the resolved scheduler node.
LookupNodeRPC is issued.LookupNodecalls andsuccessful create/fork assignment recording. Scheduler errors and
NotFoundresponses will not be cached.delete lifecycle events in
ReportSandboxEvent. The removal would onlydelete the binding if it still points to the reporting node, preventing a
delayed delete event from removing a newer assignment.
evict and perform one uncached scheduler lookup. Retry at most once and only
for explicitly replay-safe control-plane requests. WebSocket, streaming,
non-replayable, and data-plane 404 responses will not be retried.
evictions, and refetches, together with unit tests for expiry, capacity,
concurrency, invalidation, and retry behavior.
Before I start the implementation, could you confirm:
ReportSandboxEventwith conditional delete handling preferred,or would you rather introduce an explicit scheduler binding-delete RPC?
GET,HEAD, andDELETErequests?configuration?
If this direction looks good, I can prepare the implementation and tests.