MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / handoff_codex_stop

Method handoff_codex_stop

atomic-cli/src/commands/agent/hooks.rs:288–323  ·  view source on GitHub ↗
(&self, input: &[u8])

Source from the content-addressed store, hash-verified

286 }
287
288 fn handoff_codex_stop(&self, input: &[u8]) -> CliResult<()> {
289 let exe = std::env::current_exe().map_err(|e| {
290 CliError::Internal(anyhow!("Failed to resolve atomic executable: {}", e))
291 })?;
292
293 let mut child = ProcessCommand::new(exe)
294 .arg("agent")
295 .arg("hooks")
296 .arg(&self.agent_name)
297 .arg(&self.verb)
298 .arg("--foreground")
299 .stdin(Stdio::piped())
300 .stdout(Stdio::null())
301 .stderr(Stdio::null())
302 .spawn()
303 .map_err(|e| {
304 CliError::Internal(anyhow!(
305 "Failed to start background Codex Stop recorder: {}",
306 e
307 ))
308 })?;
309
310 if let Some(mut stdin) = child.stdin.take() {
311 stdin.write_all(input).map_err(|e| {
312 CliError::Io(std::io::Error::new(
313 e.kind(),
314 format!(
315 "Failed to pass Codex Stop input to background recorder: {}",
316 e
317 ),
318 ))
319 })?;
320 }
321
322 Ok(())
323 }
324}
325
326// Tests

Callers 1

runMethod · 0.80

Calls 1

kindMethod · 0.45

Tested by

no test coverage detected