MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / codex_subagent_needs_context

Function codex_subagent_needs_context

src/hooks/codex.rs:350–376  ·  view source on GitHub ↗
(parsed: &Value)

Source from the content-addressed store, hash-verified

348}
349
350fn 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
378fn bool_field(value: &Value, keys: &[&str]) -> Option<bool> {
379 keys.iter()

Callers 1

Calls 4

bool_fieldFunction · 0.85
empty_array_fieldFunction · 0.85
text_fieldFunction · 0.70

Tested by

no test coverage detected