CurrentAgentModel returns the model ID for the current agent. Returns the tracked model from AgentInfoEvent, or falls back to session overrides. Returns empty string if no model information is available (fail-open scenario).
(ctx context.Context)
| 404 | // Returns the tracked model from AgentInfoEvent, or falls back to session overrides. |
| 405 | // Returns empty string if no model information is available (fail-open scenario). |
| 406 | func (a *App) CurrentAgentModel(ctx context.Context) string { |
| 407 | if a.currentAgentModel != "" { |
| 408 | return a.currentAgentModel |
| 409 | } |
| 410 | // Fallback to session overrides |
| 411 | if a.session != nil && a.session.AgentModelOverrides != nil { |
| 412 | agentName := a.runtime.CurrentAgentName(ctx) |
| 413 | if modelRef, ok := a.session.AgentModelOverrides[agentName]; ok { |
| 414 | return modelRef |
| 415 | } |
| 416 | } |
| 417 | return "" |
| 418 | } |
| 419 | |
| 420 | // TrackCurrentAgentModel updates the tracked model ID for the current agent. |
| 421 | // This is called when AgentInfoEvent is received from the runtime. |
nothing calls this directly
no test coverage detected