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

Function normalize_stop_raw

atomic-agent/src/hooks/codex.rs:507–517  ·  view source on GitHub ↗
(mut raw: Value)

Source from the content-addressed store, hash-verified

505}
506
507fn normalize_stop_raw(mut raw: Value) -> Value {
508 let stop_hook_active = raw.get("stop_hook_active").and_then(Value::as_bool);
509 if let Some(active) = stop_hook_active {
510 if let Some(obj) = raw.as_object_mut() {
511 obj.entry("finish_reason".to_string()).or_insert_with(|| {
512 Value::String(if active { "tool-calls" } else { "stop" }.to_string())
513 });
514 }
515 }
516 raw
517}
518
519fn normalize_tool_raw(mut raw: Value) -> Value {
520 let Some(response) = raw.get("tool_response").cloned() else {

Callers 1

parse_eventMethod · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected