agentThinkingLabel returns a short, user-facing label for the effective thinking-effort level of the agent's current model: the effort level (e.g. "high"), "adaptive" for adaptive budgets, the decimal token count for token-based budgets, "off" when thinking is disabled on a reasoning-capable model,
(ctx context.Context, a *agent.Agent)
| 1321 | // model, or "" when the model has no selectable thinking configuration to |
| 1322 | // display. |
| 1323 | func (r *LocalRuntime) agentThinkingLabel(ctx context.Context, a *agent.Agent) string { |
| 1324 | models := a.EffectiveModels() |
| 1325 | if len(models) == 0 { |
| 1326 | return "" |
| 1327 | } |
| 1328 | cfg := models[0].BaseConfig().ModelConfig |
| 1329 | // Only models that can actually reason get a thinking line. |
| 1330 | if !r.modelSupportsThinking(ctx, &cfg) { |
| 1331 | return "" |
| 1332 | } |
| 1333 | budget := cfg.ThinkingBudget |
| 1334 | if budget == nil || budget.IsDisabled() { |
| 1335 | return "off" |
| 1336 | } |
| 1337 | if l, ok := budget.EffortLevel(); ok { |
| 1338 | return l.String() |
| 1339 | } |
| 1340 | if budget.IsAdaptive() { |
| 1341 | return "adaptive" |
| 1342 | } |
| 1343 | return strconv.Itoa(budget.Tokens) // token-based budget |
| 1344 | } |
| 1345 | |
| 1346 | // SessionStore returns the session store for browsing/loading past sessions. |
| 1347 | func (r *LocalRuntime) SessionStore() session.Store { |