llm: fix duration timer — start before subprocess, not after

This commit is contained in:
ProofOfConcept 2026-03-05 22:58:40 -05:00
parent a9b0438c74
commit 22e2bc73c8

View file

@ -59,6 +59,8 @@ fn call_model(agent: &str, model: &str, prompt: &str) -> Result<String, String>
cmd.env("CLAUDE_CONFIG_DIR", dir); cmd.env("CLAUDE_CONFIG_DIR", dir);
} }
let start = std::time::Instant::now();
let result = unsafe { let result = unsafe {
cmd.pre_exec(|| { cmd.pre_exec(|| {
libc::prctl(libc::PR_SET_PDEATHSIG, libc::SIGTERM); libc::prctl(libc::PR_SET_PDEATHSIG, libc::SIGTERM);
@ -67,8 +69,6 @@ fn call_model(agent: &str, model: &str, prompt: &str) -> Result<String, String>
.output() .output()
}; };
let start = std::time::Instant::now();
fs::remove_file(&tmp).ok(); fs::remove_file(&tmp).ok();
match result { match result {