mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-16 12:03:27 +00:00
perf: improve startup instrumentation and replace npx with npm install (#208)
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>
This commit is contained in:
parent
9ada842cf2
commit
e7656d78f0
7 changed files with 691 additions and 78 deletions
|
|
@ -11,6 +11,7 @@ fn main() {
|
|||
}
|
||||
|
||||
fn run() -> Result<(), CliError> {
|
||||
let started = std::time::Instant::now();
|
||||
let cli = GigacodeCli::parse();
|
||||
let config = CliConfig {
|
||||
token: cli.token,
|
||||
|
|
@ -34,5 +35,18 @@ fn run() -> Result<(), CliError> {
|
|||
eprintln!("failed to init logging: {err}");
|
||||
return Err(err);
|
||||
}
|
||||
run_command(&command, &config)
|
||||
tracing::info!(
|
||||
command = ?command,
|
||||
startup_ms = started.elapsed().as_millis() as u64,
|
||||
"gigacode.run: command starting"
|
||||
);
|
||||
let command_started = std::time::Instant::now();
|
||||
let result = run_command(&command, &config);
|
||||
tracing::info!(
|
||||
command = ?command,
|
||||
command_ms = command_started.elapsed().as_millis() as u64,
|
||||
total_ms = started.elapsed().as_millis() as u64,
|
||||
"gigacode.run: command exited"
|
||||
);
|
||||
result
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue