CycleAgentThinkingLevel implements [Runtime.CycleAgentThinkingLevel] for LocalRuntime. It reads the agent's current effective model, advances the thinking-effort level by one step through the levels that specific model supports (see [modelinfo.SupportedThinkingLevels]), re-creates the provider(s) wi
(ctx context.Context, agentName string)
| 194 | // supports (see [modelinfo.SupportedThinkingLevels]), re-creates the |
| 195 | // provider(s) with the new level, and installs them as a runtime override. |
| 196 | func (r *LocalRuntime) CycleAgentThinkingLevel(ctx context.Context, agentName string) (effort.Level, error) { |
| 197 | return r.applyAgentThinkingLevel(ctx, agentName, func(supported []effort.Level, current effort.Level) (effort.Level, error) { |
| 198 | // Clamp first so a configured level the model does not support re-enters |
| 199 | // the cycle at the nearest supported tier instead of resetting it. |
| 200 | return effort.NextSupportedLevel(supported, effort.Clamp(supported, current)), nil |
| 201 | }) |
| 202 | } |
| 203 | |
| 204 | // SetAgentThinkingLevel implements [Runtime.SetAgentThinkingLevel] for |
| 205 | // LocalRuntime. The requested level must be one the agent's current model |