fix: ctrl-c exit + agent dump

This commit is contained in:
cpacker
2025-10-25 23:37:41 -07:00
parent 2a93f9ab55
commit 83aeaff3fd
3 changed files with 5 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ import type { SessionStatsSnapshot } from "../../agent/stats";
interface SessionStatsProps {
stats: SessionStatsSnapshot;
agentId?: string;
}
function formatDuration(ms: number): string {
@@ -16,7 +17,7 @@ function formatNumber(n: number): string {
return n.toLocaleString();
}
export function SessionStats({ stats }: SessionStatsProps) {
export function SessionStats({ stats, agentId }: SessionStatsProps) {
const wallDuration = formatDuration(stats.totalWallMs);
const apiDuration = formatDuration(stats.totalApiMs);
@@ -29,6 +30,7 @@ export function SessionStats({ stats }: SessionStatsProps) {
{formatNumber(stats.usage.promptTokens)} input,{" "}
{formatNumber(stats.usage.completionTokens)} output
</Text>
{agentId && <Text dimColor>Agent ID: {agentId}</Text>}
</Box>
);
}