getEffectiveModelID returns the currently active model ID for an agent, accounting for any active fallback cooldown. During a cooldown period, this returns the fallback model ID instead of the configured primary model, so the UI reflects the actual model in use.
(ctx context.Context, a *agent.Agent)
| 1266 | // for any active fallback cooldown. During a cooldown period, this returns the fallback |
| 1267 | // model ID instead of the configured primary model, so the UI reflects the actual model in use. |
| 1268 | func (r *LocalRuntime) getEffectiveModelID(ctx context.Context, a *agent.Agent) modelsdev.ID { |
| 1269 | cooldownState := r.fallback.cooldowns.Get(a.Name()) |
| 1270 | if cooldownState != nil { |
| 1271 | fallbacks := a.FallbackModels() |
| 1272 | if cooldownState.fallbackIndex >= 0 && cooldownState.fallbackIndex < len(fallbacks) { |
| 1273 | return fallbacks[cooldownState.fallbackIndex].ID() |
| 1274 | } |
| 1275 | } |
| 1276 | return getAgentModelID(ctx, a) |
| 1277 | } |
| 1278 | |
| 1279 | // agentDetailsFromTeam converts team agent info to AgentDetails for events. |
| 1280 | // It accounts for active fallback cooldowns, returning the effective model |
no test coverage detected