(parsed: &Value)
| 348 | } |
| 349 | |
| 350 | fn codex_subagent_needs_context(parsed: &Value) -> bool { |
| 351 | bool_field( |
| 352 | parsed, |
| 353 | &["is_new", "new_subagent", "fresh_subagent", "no_history"], |
| 354 | ) == Some(true) |
| 355 | || bool_field( |
| 356 | parsed, |
| 357 | &[ |
| 358 | "has_history", |
| 359 | "history_included", |
| 360 | "receives_history", |
| 361 | "conversation_history_included", |
| 362 | ], |
| 363 | ) == Some(false) |
| 364 | || text_field( |
| 365 | parsed, |
| 366 | &[ |
| 367 | "history_mode", |
| 368 | "context_mode", |
| 369 | "conversation_history", |
| 370 | "source", |
| 371 | "reason", |
| 372 | ], |
| 373 | ) |
| 374 | .is_some_and(|value| matches_no_history_marker(&value)) |
| 375 | || empty_array_field(parsed, &["history", "messages", "conversation"]) |
| 376 | } |
| 377 | |
| 378 | fn bool_field(value: &Value, keys: &[&str]) -> Option<bool> { |
| 379 | keys.iter() |
no test coverage detected