mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #69] [MERGED] [1/6] fix(api): return the JSON error envelope for unmatched routes #153
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#153
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/69
Author: @JoyboyBrian
Created: 7/29/2026
Status: ✅ Merged
Merged: 7/31/2026
Merged by: @yingdi-shan
Base:
main← Head:e2b-build/01-error-envelope📝 Commits (1)
9b9e271fix(api): return the JSON error envelope for unmatched routes📊 Changes
1 file changed (+30 additions, -1 deletions)
View changed files
📝
src/api/proxy.rs(+30 -1)📄 Description
What
Return the standard JSON API error envelope for unmatched control-plane routes instead of an empty 404 response. The focused proxy test verifies the status, content type, error code, and route-specific message.
e2b-build/01-error-envelopee2b-build/02-alias-rebuilde2b-build/03-build-file-storee2b-build/04-upload-apie2b-build/05-copy-plane2b-build/06-copy-execWhy
The maintainer asked that the full change in #28 be split into smaller reviewable PRs. This is layer 1 of that six-PR stack and gives JSON clients a parseable error for unknown API routes.
Related issue
Related: #28
#28 remains the full reference PR containing the design discussion, prior review history, and two-node E2E evidence.
Scope and non-goals
This layer changes only
src/api/proxy.rs: the unmatched-route fallback and its test. It preserves the connection-isolation fix already onmain. It does not include template storage, upload, COPY planning, or execution changes; those are layers 2–6.Design and behavior changes
Requests without sandbox routing headers that miss all control-plane routes now return HTTP 404 with the generated API
ErrorJSON model. Proxied sandbox routing and connection-generation isolation are unchanged.Compatibility and operations
Validation
make fmtmake clippymake test-unitcargo clippy --workspace --all-targets --all-features -- -D warningscargo test -p agentenv --libmake -C services test(required whenservices/changes)maketargetCommands and results:
All listed commands pass in the Linux verification environment. The tmpfs
TMPDIRavoids a pre-existingETXTBSYfrom devmachine's shared/tmpin an unrelated credential-helper test. The proxy unit test directly covers this layer. The full #28 two-node E2E run is retained as reference evidence, though this response-only layer does not require a multi-node scenario.Skipped checks and reasons: integration tests, service tests, code generation, docs checks, and benchmarks are outside this layer's scope.
Risks and reviewer notes
The behavior change is intentionally limited to requests that have no sandbox routing header and miss every control-plane route. Review the single commit on this branch.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.