feat: add sandbox agent HTTP handlers and entry point - #7
Conversation
- Add AgentState with mutex-protected unassigned/assigned state machine - Implement POST /exec with constant-time bearer token auth (hmac.Equal) - Implement POST /assign for one-time warm-pool token delivery (409 on repeat) - Implement GET /health as unauthenticated readiness probe - Wire cmd/agent/main.go with HTTP server on :8090, Go 1.22+ routing - Graceful shutdown on SIGTERM/SIGINT with 310s timeout (max command + buffer) 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 (2)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)**⚙️ CodeRabbit configuration file
Files:
🧬 Code graph analysis (2)cmd/agent/main.go (2)
pkg/sandbox/handler.go (2)
🔀 Multi-repo context codeready-toolchain/mcp-server-devsandbox, codeready-toolchain/host-operator, codeready-toolchain/toolchain-e2e, codeready-toolchain/mcp-common, codeready-toolchain/api, codeready-toolchain/toolchain-commonLinked repositories findings
Summary / implication:
🔇 Additional comments (11)
WalkthroughThis PR implements the sandbox agent runtime by introducing HTTP handlers for health checks, agent assignment, and command execution, then wires the complete agent bootstrap and graceful shutdown in main(). The agent reads an auth token from environment, initializes state and a bash session, registers the three endpoints, and listens on port 8090 with signal-driven shutdown. ChangesSandbox Agent Runtime Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
alexeykazakov
left a comment
There was a problem hiding this comment.
Do not forget to add tests when possible
yes they are to be done as a separate task |
Assisted By: Cursor
Summary by CodeRabbit
Release Notes