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

Method handoff_codex_stop

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

Source from the content-addressed store, hash-verified

315 }
316
317 fn handoff_codex_stop(&self, input: &[u8]) -> CliResult<()> {
318 let exe = std::env::current_exe().map_err(|e| {
319 CliError::Internal(anyhow!("Failed to resolve atomic executable: {}", e))
320 })?;
321
322 let mut child = ProcessCommand::new(exe)
323 .arg("agent")
324 .arg("hooks")
325 .arg(&self.agent_name)
326 .arg(&self.verb)
327 .arg("--foreground")
328 .stdin(Stdio::piped())
329 .stdout(Stdio::null())
330 .stderr(Stdio::null())
331 .spawn()
332 .map_err(|e| {
333 CliError::Internal(anyhow!(
334 "Failed to start background Codex Stop recorder: {}",
335 e
336 ))
337 })?;
338
339 if let Some(mut stdin) = child.stdin.take() {
340 stdin.write_all(input).map_err(|e| {
341 CliError::Io(std::io::Error::new(
342 e.kind(),
343 format!(
344 "Failed to pass Codex Stop input to background recorder: {}",
345 e
346 ),
347 ))
348 })?;
349 }
350
351 Ok(())
352 }
353}
354
355// Tests

Callers 1

runMethod · 0.80

Calls 1

kindMethod · 0.45

Tested by

no test coverage detected