Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

feat(realtime): mount rt-9 cost HUD by the voice toggle + cap control in Settings (Realtime Michael P2)

Chaitanya Giriab2999011359
diff --git a/src/renderer/src/components/AgentCard.tsx b/src/renderer/src/components/AgentCard.tsx
index a90390de..47978f5e 100644
--- a/src/renderer/src/components/AgentCard.tsx
+++ b/src/renderer/src/components/AgentCard.tsx
@@ -2,6 +2,7 @@ import { PixelPanel } from './PixelPanel';
import { PixelBadge, StatusKind } from './PixelBadge';
import { SpritePortrait } from './SpritePortrait';
import { RealtimeMichaelToggle } from './RealtimeMichaelToggle';
+import { CostHud } from '@/realtime/CostHud';
import { AccentColorName } from '@/design/tokens';
import { OfficeCharacterName } from '@/scene/office/cast';
@@ -116,7 +117,8 @@ export function AgentCard({
{/* Voice toggle (god/Michael only). Compact form fits the cramped card row;
it stops its own click so it never selects the card. */}
{isGod && (
- <span style={{ marginLeft: 'auto', flexShrink: 0 }}>
+ <span style={{ marginLeft: 'auto', flexShrink: 0, display: 'inline-flex', gap: 6, alignItems: 'center' }}>
+ <CostHud compact />
<RealtimeMichaelToggle compact />
</span>
)}
diff --git a/src/renderer/src/components/FullscreenTerminal.tsx b/src/renderer/src/components/FullscreenTerminal.tsx
index 56c823d9..9fcf1d81 100644
--- a/src/renderer/src/components/FullscreenTerminal.tsx
+++ b/src/renderer/src/components/FullscreenTerminal.tsx
@@ -7,6 +7,7 @@ import { disposeTerminal } from './terminalPool';
import { Icon } from './Icon';
import { SpritePortrait } from './SpritePortrait';
import { RealtimeMichaelToggle } from './RealtimeMichaelToggle';
+import { CostHud } from '@/realtime/CostHud';
import { useStore, type Agent } from '@/store/store';
import { usePtyParser } from '@/hooks/usePtyParser';
@@ -117,6 +118,10 @@ export function FullscreenTerminal() {
{/* Voice toggle relocates here when Michael (the god) is fullscreen, so the
mic stays reachable while the card behind the overlay is hidden. */}
{agent.isGod && <RealtimeMichaelToggle />}
+ {/* rt-9 cost HUD (spend cap + live $ meter) sits by the voice toggle in the
+ roomy fullscreen header — the primary voice UX surface. */}
+ {agent.isGod && <CostHud />}
+ {agent.isGod && <CostHud compact />}
<PixelButton variant="destructive" size="sm" onClick={onKill}>
<span style={{ display: 'inline-flex', gap: 4, alignItems: 'center' }}>
<Icon name="x" /> kill
diff --git a/src/renderer/src/components/SettingsModal.tsx b/src/renderer/src/components/SettingsModal.tsx
index c27a44c2..5edf00df 100644
--- a/src/renderer/src/components/SettingsModal.tsx
+++ b/src/renderer/src/components/SettingsModal.tsx
@@ -9,6 +9,7 @@ import { McpDefaultsSettings } from './McpDefaultsSettings';
import { IntegrationsRegistry } from './IntegrationsRegistry';
import { AiEnginesSettings } from './AiEnginesSettings';
import { RealtimeDevicePicker } from '@/realtime/DevicePicker';
+import { CostHud } from '@/realtime/CostHud';
export interface SettingsModalProps {
config: HarnessConfig;
@@ -1206,6 +1207,7 @@ export function SettingsModal({ config, onClose }: SettingsModalProps) {
</span>
</div>
<RealtimeDevicePicker />
+ <CostHud />
</div>
</>
)}
diff --git a/src/renderer/src/realtime/CostHud.tsx b/src/renderer/src/realtime/CostHud.tsx
index 6b0937d8..d0d1a378 100644
--- a/src/renderer/src/realtime/CostHud.tsx
+++ b/src/renderer/src/realtime/CostHud.tsx
@@ -48,7 +48,15 @@ const capInputStyle: React.CSSProperties = {
color: 'var(--cth-ink-900)'
};
-export function CostHud(): React.ReactElement {
+export interface CostHudProps {
+ /** Compact inline readout (sits next to the voice toggle): just the live $,
+ * colored by cap status, and only while a session is metering — renders
+ * nothing when off, so it never clutters the toggle row. The full form (cap
+ * control + token breakdown) is the default, for a roomy spot like Settings. */
+ compact?: boolean;
+}
+
+export function CostHud({ compact = false }: CostHudProps): React.ReactElement | null {
const { usd, inputTokens, outputTokens, capUsd, overCap, startedTs, setCap } = useRealtimeCost();
// Local text state so the field can be cleared/typed without fighting the store.
const [capText, setCapText] = useState(capUsd != null ? String(capUsd) : '');
@@ -68,6 +76,27 @@ export function CostHud(): React.ReactElement {
const near = capUsd != null && !overCap && ratio >= WARN_RATIO;
const meterColor = overCap ? 'var(--cth-danger, #c0392b)' : near ? 'var(--cth-warn, #b8860b)' : 'var(--cth-ink-900)';
+ // Compact: a glanceable $ chip next to the toggle, only while a session runs.
+ if (compact) {
+ if (!live) return null;
+ return (
+ <span
+ title={capUsd != null ? `${formatUsd(usd)} of ${formatUsd(capUsd)} cap this voice session` : `${formatUsd(usd)} this voice session`}
+ style={{
+ fontFamily: 'var(--cth-font-mono)',
+ fontSize: 12,
+ fontWeight: 600,
+ color: meterColor,
+ flexShrink: 0,
+ whiteSpace: 'nowrap'
+ }}
+ >
+ {formatUsd(usd)}
+ {overCap ? ' ⚠' : ''}
+ </span>
+ );
+ }
+
return (
<div style={wrap}>
<label style={{ display: 'flex', alignItems: 'center', gap: 6 }}>