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

Function extract_tool_status

atomic-agent/src/hooks/codex.rs:552–569  ·  view source on GitHub ↗
(response: &Value)

Source from the content-addressed store, hash-verified

550}
551
552fn extract_tool_status(response: &Value) -> Option<String> {
553 if response
554 .get("success")
555 .and_then(Value::as_bool)
556 .is_some_and(|success| success)
557 {
558 return Some("completed".to_string());
559 }
560 if response
561 .get("success")
562 .and_then(Value::as_bool)
563 .is_some_and(|success| !success)
564 || response.get("error").is_some()
565 {
566 return Some("error".to_string());
567 }
568 None
569}
570
571fn extract_duration_ms(response: &Value) -> Option<u64> {
572 response

Callers 1

normalize_tool_rawFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected