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

Method handoff_codex_stop

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

Source from the content-addressed store, hash-verified

219 }
220
221 fn handoff_codex_stop(&self, input: &[u8]) -> CliResult<()> {
222 let exe = std::env::current_exe().map_err(|e| {
223 CliError::Internal(anyhow!("Failed to resolve atomic executable: {}", e))
224 })?;
225
226 let mut child = ProcessCommand::new(exe)
227 .arg("agent")
228 .arg("hooks")
229 .arg(&self.agent_name)
230 .arg(&self.verb)
231 .arg("--foreground")
232 .stdin(Stdio::piped())
233 .stdout(Stdio::null())
234 .stderr(Stdio::null())
235 .spawn()
236 .map_err(|e| {
237 CliError::Internal(anyhow!(
238 "Failed to start background Codex Stop recorder: {}",
239 e
240 ))
241 })?;
242
243 if let Some(mut stdin) = child.stdin.take() {
244 stdin.write_all(input).map_err(|e| {
245 CliError::Io(std::io::Error::new(
246 e.kind(),
247 format!(
248 "Failed to pass Codex Stop input to background recorder: {}",
249 e
250 ),
251 ))
252 })?;
253 }
254
255 Ok(())
256 }
257}
258
259// Tests

Callers 1

runMethod · 0.80

Calls 1

kindMethod · 0.45

Tested by

no test coverage detected