Skip to content

Commit 2d5c116

Browse files
authored
fix: address PR review findings (Bug 1-3 + sidebar minor)
Bug 1 (runtime_events.go): use msg.ConfigPath instead of constructing 'budget.' + msg.Limit; named budget paths like 'budgets.tight.max_cost' now display correctly. Bug 2 (types.go): MaxTime comment updated from 'wall-clock duration' to 'working time — cumulative turn durations; idle time does not count'. Bug 3 (docs/configuration/budget/index.md): three occurrences of 'wall-clock time' changed to 'working time' (front-matter description, lede paragraph, and example heading). Minor (sidebar.go): removed duplicate first comment block from formatBudgetDuration.
1 parent 3589dcd commit 2d5c116

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/configuration/budget/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: "Budget"
3-
description: "Cap what a single run may spend in money, tokens, or wall-clock time."
3+
description: "Cap what a single run may spend in money, tokens, or working time."
44
keywords: docker agent, ai agents, configuration, yaml, budget, cost, limits
55
weight: 75
66
canonical: https://docs.docker.com/ai/docker-agent/configuration/budget/
77
---
88

9-
_Cap what a single run may spend in money, tokens, or wall-clock time._
9+
_Cap what a single run may spend in money, tokens, or working time._
1010

1111
## Overview
1212

@@ -176,7 +176,7 @@ budget:
176176
max_cost: 5.00
177177
```
178178

179-
Cap wall-clock time for an unattended job:
179+
Cap working time for an unattended job:
180180

181181
```yaml
182182
agents:

pkg/config/latest/types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ type BudgetConfig struct {
8888
// compaction resets — those measure current context length, not spend.
8989
MaxTokens int64 `json:"max_tokens,omitempty" yaml:"max_tokens,omitempty"`
9090

91-
// MaxTime is the maximum wall-clock duration of the run, in Go
91+
// MaxTime is the maximum working time for the run — the cumulative
92+
// sum of turn durations, not wall-clock since the session opened.
93+
// Idle time while the user reads and types does not count. In Go
9294
// duration format ("10m", "30s", "1h30m").
9395
//
9496
// It is checked at turn boundaries, so a run stops at the first

pkg/tui/components/sidebar/sidebar.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,8 +1866,6 @@ func budgetPartStyle(used, limit float64) lipgloss.Style {
18661866
return contextGaugeStyle(level, styles.TabAccentStyle)
18671867
}
18681868

1869-
// formatBudgetDuration renders whole seconds, so a live reading doesn't
1870-
// jitter with sub-second noise.
18711869
// formatBudgetDuration renders a whole-second reading compactly, dropping
18721870
// zero components so a round ceiling reads "10m" and "1h" rather than
18731871
// Duration.String's "10m0s" and "1h0m0s" — the budget column is the

pkg/tui/page/chat/runtime_events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ func (p *chatPage) handleToolCallResponse(msg *runtime.ToolCallResponseEvent) te
452452
func (p *chatPage) handleBudgetExceeded(msg *runtime.BudgetExceededEvent) tea.Cmd {
453453
spinnerCmd := p.setWorking(false)
454454
warnCmd := notification.WarningCmd(fmt.Sprintf(
455-
"Run stopped by budget.%s — used %s of %s.", msg.Limit, msg.Used, msg.Max,
455+
"Run stopped by %s — used %s of %s.", msg.ConfigPath, msg.Used, msg.Max,
456456
))
457457
return tea.Batch(spinnerCmd, warnCmd)
458458
}

0 commit comments

Comments
 (0)