Fall back to model_id for the logged model

Agents store their model only in model_id, so neither log_activity nor
agent_log_context bound a model key. start_agent_span already reads it.
This commit is contained in:
Alex committed 2026-09-24 13:47:46 +01:00
1 parent 9df90ab9df
commit cf9a5e9cb8
2 files changed
+6 -1

No files matched your search

+5 -1
View File
@@ -97,7 +97,11 @@ def _agent_log_keys(agent: Any, data: Optional[Dict] = None) -> Dict[str, Any]:
"agent_id": getattr(agent, "agent_id", None),
"conversation_id": getattr(agent, "conversation_id", None),
"endpoint": data.get("endpoint", ""),
"model": getattr(agent, "gpt_model", None) or getattr(agent, "model", None),
"model": (
getattr(agent, "gpt_model", None)
or getattr(agent, "model", None)
or getattr(agent, "model_id", None)
),
}