Before submitting
Problem
The Agents widget card and the Agents view task header render subagent cost with exactly two decimals ($${task.cost.toFixed(2)}), while the shell bar / fullscreen header formats cost through the shared formatCost() helper, which shows three decimals below $1 (e.g. $0.090) and two at or above $1 (e.g. $12.50). A subagent that cost $0.09 shows $0.09 in the Agents UI while the same magnitude renders $0.090 in the header: the two surfaces drift on how they paint the same fact, and small costs lose precision.
Steps to reproduce
- Start gentle-shell.
- Run a subagent (
subagent_run) that accumulates a cost below $1 (e.g. $0.09).
- Observe the Agents card above the editor and the Agents view (
alt+a) task header.
- Compare with the shell bar / fullscreen header cost segment.
Expected and actual behavior
Expected:
Subagent cost uses the same formatCost() as the header: three decimals below $1, two at or above $1 ($0.090, $12.50).
Actual:
Subagent cost is hardcoded to two decimals ($0.09, $12.50), diverging from the header.
gentle-pi version
3.7.0 (npm gentle-pi)
Pi version
0.87.1
Operating system
Linux
Relevant logs or error output (optional)
Source: lib/agents-widget.ts (metaFields) and lib/agents-view.ts (taskHeader) hardcode $${task.cost.toFixed(2)}, while lib/shell-bar.ts exports the shared formatCost(total, subscription) already used by the header.
Before submitting
Problem
The Agents widget card and the Agents view task header render subagent cost with exactly two decimals (
$${task.cost.toFixed(2)}), while the shell bar / fullscreen header formats cost through the sharedformatCost()helper, which shows three decimals below $1 (e.g.$0.090) and two at or above $1 (e.g.$12.50). A subagent that cost $0.09 shows$0.09in the Agents UI while the same magnitude renders$0.090in the header: the two surfaces drift on how they paint the same fact, and small costs lose precision.Steps to reproduce
subagent_run) that accumulates a cost below $1 (e.g. $0.09).alt+a) task header.Expected and actual behavior
Expected:
Subagent cost uses the same
formatCost()as the header: three decimals below $1, two at or above $1 ($0.090,$12.50).Actual:
Subagent cost is hardcoded to two decimals (
$0.09,$12.50), diverging from the header.gentle-pi version
3.7.0 (npm
gentle-pi)Pi version
0.87.1
Operating system
Linux
Relevant logs or error output (optional)
Source:
lib/agents-widget.ts(metaFields) andlib/agents-view.ts(taskHeader) hardcode$${task.cost.toFixed(2)}, whilelib/shell-bar.tsexports the sharedformatCost(total, subscription)already used by the header.