mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 11:02:20 +00:00
Add comprehensive tracing instrumentation across the entire agent startup path (gigacode CLI, ACP HTTP adapter, agent installation, and process spawning) to enable detailed performance profiling. Replace npm-based agent process launchers that use npx (incurring resolution overhead on every spawn) with pre-installed npm packages, reducing startup latency. Improve error diagnostics when agent processes crash by capturing exit codes and stderr tails. Update error handling to map exited processes to dedicated error variants with actionable error messages. Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| Cargo.toml | ||
| README.md | ||
acp-http-adapter
Minimal ACP HTTP to stdio proxy.
Endpoints
GET /v1/healthPOST /v1/rpcGET /v1/rpc(SSE)DELETE /v1/rpc
Stdio framing
Uses ACP stdio framing from ACP docs:
- UTF-8 JSON-RPC messages
- one message per line
- newline-delimited (
\n) - no embedded newlines in messages
Run
cargo run -p acp-http-adapter -- \
--host 127.0.0.1 \
--port 7591 \
--registry-json '{"distribution":{"npx":{"package":"@zed-industries/codex-acp"}}}'
--registry-json accepts:
- full registry document (
{"agents":[...]}) with--registry-agent-id - single registry entry (
{"id":"...","distribution":...}) - direct distribution object (
{"npx":...}or{"binary":...})
Library
use std::time::Duration;
use acp_http_adapter::{run_server, ServerConfig};
run_server(ServerConfig {
host: "127.0.0.1".to_string(),
port: 7591,
registry_json: r#"{"distribution":{"npx":{"package":"@zed-industries/codex-acp"}}}"#.to_string(),
registry_agent_id: None,
rpc_timeout: Duration::from_secs(120),
}).await?;