docs: add openspec for SANDBOX-1807 agent HTTP handlers - #5
Conversation
- Proposal, design, tasks, and behavioral specs for the sandbox agent HTTP layer (POST /exec, POST /assign, GET /health) and entry point - Covers agent state machine, bearer token auth, graceful shutdown, Go 1.22+ routing, and 310s shutdown timeout coordination with K8s Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Feny Mehta <fbm3307@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (6)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)**⚙️ CodeRabbit configuration file
Files:
🪛 LanguageToolopenspec/changes/archive/2026-05-14-agent-http-handlers/design.md[grammar] ~113-~113: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🪛 markdownlint-cli2 (0.22.1)openspec/changes/archive/2026-05-14-agent-http-handlers/specs/agent-http-handlers/spec.md[warning] 49-49: Spaces inside code span elements (MD038, no-space-in-code) openspec/changes/archive/2026-05-14-agent-http-handlers/tasks.md[warning] 19-19: Spaces inside code span elements (MD038, no-space-in-code) 🔇 Additional comments (6)
WalkthroughThis PR adds OpenSpec documentation for a sandbox agent HTTP layer, including design decisions, endpoint specifications, and implementation tasks for three HTTP endpoints on port 8090 serving POST /exec (bearer token auth), POST /assign (token assignment), and GET /health (readiness). ChangesAgent HTTP Server Design, Specifications, and Tasks
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
alexeykazakov
left a comment
There was a problem hiding this comment.
Looks good overall. But please take a look at my comments.
| Use `mux.HandleFunc("POST /exec", ...)` instead of manual method checks. | ||
|
|
||
| **Rationale:** | ||
| - Repo is Go 1.24+; `use-modern-go` skill says to use modern idioms |
There was a problem hiding this comment.
Not related to this design but let's switch to Go 1.25, as a separate task.
There was a problem hiding this comment.
Agreed — tracked as a separate task. The Go 1.22+ routing features we reference here work fine on 1.24 and will continue to work on 1.25
| - Update `cmd/agent/main.go` with: | ||
| - `SANDBOX_AUTH_TOKEN` env var reading for initial state | ||
| - `BashSession` creation with eager initialization | ||
| - HTTP mux with Go 1.22+ method-based routing (`POST /exec`, `POST /assign`, `GET /health`) |
There was a problem hiding this comment.
Have you considered using some lightweight frameworks like https://github.com/labstack/echo (v. 5+)? This is what we use in tarsy, GC, reg-service. I don't know if it gives us anything in the agent context though. The agent needs are pretty minimal.
There was a problem hiding this comment.
@alexeykazakov i did consider it — Echo is a good fit for services with rich routing, middleware stacks, and request binding (tarsy, reg-service). The sandbox agent has 3 endpoints, no middleware, and the stdlib net/http with Go 1.22+ method routing covers everything we need (automatic 405, no boilerplate method checks). Adding Echo would be a dependency with no functional benefit here. mcp-server-devsandbox also uses stdlib net/http for the same reason.
WDYT?
There was a problem hiding this comment.
I'm fine with sticking with plain Go for now.
Summary by CodeRabbit