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

Function find_model_id

src/sessions/codex_app_server.rs:391–430  ·  view source on GitHub ↗
(value: &Value)

Source from the content-addressed store, hash-verified

389}
390
391fn find_model_id(value: &Value) -> Option<String> {
392 const MODEL_KEYS: [&str; 13] = [
393 "model",
394 "model_id",
395 "modelId",
396 "model_name",
397 "modelName",
398 "model_slug",
399 "modelSlug",
400 "model_display_name",
401 "modelDisplayName",
402 "display_model",
403 "displayModel",
404 "display_model_name",
405 "displayModelName",
406 ];
407 match value {
408 Value::Object(map) => {
409 for key in MODEL_KEYS {
410 if let Some(model) = map
411 .get(key)
412 .and_then(Value::as_str)
413 .filter(|model| !model.trim().is_empty())
414 {
415 return Some(model.trim().to_string());
416 }
417 }
418 map.iter()
419 .filter(|(key, _)| {
420 !matches!(
421 key.as_str(),
422 "provider" | "model_provider" | "modelProvider" | "clientInfo"
423 )
424 })
425 .find_map(|(_, child)| find_model_id(child))
426 }
427 Value::Array(items) => items.iter().find_map(find_model_id),
428 _ => None,
429 }
430}
431
432pub fn build_codex_summary_prompt(request: &LcmSummaryRequest) -> String {
433 let mut prompt = String::new();

Callers 2

wait_for_turn_summaryFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected