MCPcopy Index your code
hub / github.com/docker/docker-agent / agentThinkingLabel

Method agentThinkingLabel

pkg/runtime/runtime.go:1323–1344  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1321// model, or "" when the model has no selectable thinking configuration to
1322// display.
1323func (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.
1347func (r *LocalRuntime) SessionStore() session.Store {

Callers 2

TestAgentThinkingLabelFunction · 0.95
agentDetailsFromTeamMethod · 0.95

Calls 7

modelSupportsThinkingMethod · 0.95
EffectiveModelsMethod · 0.80
BaseConfigMethod · 0.65
IsDisabledMethod · 0.45
EffortLevelMethod · 0.45
StringMethod · 0.45
IsAdaptiveMethod · 0.45

Tested by 1

TestAgentThinkingLabelFunction · 0.76