Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(frontend): Display run cost correctly - convert cents to dollars run detail components (#10997)

Copilot7c9db7419acd
diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx
index e49763a50f..9e54801860 100644
--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/AgentRunsView/components/RunDetailHeader/RunDetailHeader.tsx
@@ -144,7 +144,7 @@ export function RunDetailHeader({
<>
<span className="mx-1 inline-block text-zinc-200">|</span>
<Text variant="small" className="!text-zinc-600">
- Cost: ${run.stats.cost}
+ Cost: ${(run.stats.cost / 100).toFixed(2)}
</Text>
</>
)}
diff --git a/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowRunsStatus.tsx b/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowRunsStatus.tsx
index 0da81ec727..603982cba5 100644
--- a/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowRunsStatus.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/monitoring/components/FlowRunsStatus.tsx
@@ -112,12 +112,13 @@ export const FlowRunsStatus: React.FC<{
</p>
{filteredFlowRuns.some((r) => r.stats) && (
<p>
- <strong>Total cost:</strong>{" "}
- {filteredFlowRuns.reduce(
- (total, run) => total + (run.stats?.cost ?? 0),
- 0,
- )}{" "}
- seconds
+ <strong>Total cost:</strong> $
+ {(
+ filteredFlowRuns.reduce(
+ (total, run) => total + (run.stats?.cost ?? 0),
+ 0,
+ ) / 100
+ ).toFixed(2)}
</p>
)}
</div>