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

Function normalize_stop_raw

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

Source from the content-addressed store, hash-verified

628}
629
630fn normalize_stop_raw(mut raw: Value) -> Value {
631 if let Some(obj) = raw.as_object_mut() {
632 // `stop_hook_active` means a previous Stop hook requested a
633 // continuation; it is not a model finish reason. Codex emits a real
634 // SessionEnd event for terminal lifecycle work, so Stop only closes
635 // the current response/turn.
636 obj.entry("finish_reason".to_string())
637 .or_insert_with(|| Value::String("stop".to_string()));
638 }
639 raw
640}
641
642fn normalize_tool_raw(mut raw: Value) -> Value {
643 let Some(response) = raw.get("tool_response").cloned() else {

Callers 1

parse_eventMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected