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
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
feat(talk): warn when OpenAI key missing + document Realtime key in Settings
Chaitanya Girie8dda568dbd6
diff --git a/src/renderer/src/components/AiEnginesSettings.tsx b/src/renderer/src/components/AiEnginesSettings.tsxindex 2ad6f5bf..6ede39fe 100644--- a/src/renderer/src/components/AiEnginesSettings.tsx+++ b/src/renderer/src/components/AiEnginesSettings.tsx@@ -3,6 +3,7 @@ import type { HarnessConfig, AgentProvider } from '@/store/config';import { PixelButton } from './PixelButton';import { ProviderLogo } from './ProviderLogo';import { OSS_BLOG_LINKS } from '@shared/ossModels';+import { useStore } from '@/store/store';/*** AiEnginesSettings — the v0.3.1 per-provider config surface for the BYOK CLI@@ -58,6 +59,11 @@ const headStyle: CSSProperties = {const linkStyle: CSSProperties = { color: 'var(--cth-ink-900)', textDecoration: 'underline', cursor: 'pointer' };export function AiEnginesSettings({ config }: { config: HarnessConfig }) {+ // Keep the global "OpenAI key present" signal (boolean only) live so the Talk+ // button's missing-key warning clears the instant the user saves their OpenAI key+ // here — without it the gate only refreshes on next app start. apikey:openai is+ // the same key the Realtime mint reads; saving/clearing it flips the gate.+ const setHasOpenAiKey = useStore((s) => s.setHasOpenAiKey);// Which backends already have a key stored (boolean only — never the value).const [hasKey, setHasKey] = useState<Record<string, boolean>>({});const [draftKey, setDraftKey] = useState<Record<string, string>>({});@@ -92,6 +98,8 @@ export function AiEnginesSettings({ config }: { config: HarnessConfig }) {setHasKey((s) => ({ ...s, [backend]: true }));setDraftKey((s) => ({ ...s, [backend]: '' }));setNote((s) => ({ ...s, [backend]: 'saved' }));+ // OpenAI key gates Talk — mirror presence to the store so the warning clears now.+ if (backend === 'openai') setHasOpenAiKey(true);} else setNote((s) => ({ ...s, [backend]: r.error ?? 'failed' }));} catch (e) { setNote((s) => ({ ...s, [backend]: e instanceof Error ? e.message : String(e) })); }};@@ -100,6 +108,8 @@ export function AiEnginesSettings({ config }: { config: HarnessConfig }) {await window.cth.providerKeyClear(backend);setHasKey((s) => ({ ...s, [backend]: false }));setNote((s) => ({ ...s, [backend]: 'cleared' }));+ // OpenAI key gates Talk — clearing it disables Talk; reflect that immediately.+ if (backend === 'openai') setHasOpenAiKey(false);} catch { /* noop */ }};diff --git a/src/renderer/src/components/RealtimeMichaelToggle.tsx b/src/renderer/src/components/RealtimeMichaelToggle.tsxindex 0c4c8101..ba554be9 100644--- a/src/renderer/src/components/RealtimeMichaelToggle.tsx+++ b/src/renderer/src/components/RealtimeMichaelToggle.tsx@@ -88,8 +88,12 @@ export function RealtimeMichaelToggle({ compact = false }: RealtimeMichaelToggleconst noKey = !hasOpenAiKey;// Without a BYOK OpenAI key: stay visible but disabled (matches FreeFlowButton).+ // Talk mints an ephemeral token from the OpenAI key (apikey:openai) — the SAME+ // OpenAI provider key set under AI Engines, used for the Realtime voice API. The+ // tooltip carries the full WHY; the inline chip below gives a discoverable cue so+ // the user never just hits a silently-dead button on connect.const title = noKey- ? 'Add an OpenAI API key in Settings to talk to Michael.'+ ? 'Talk needs your OpenAI API key (used for the Realtime voice API). Add it in Settings → AI Engines.': error? `${view.help} — ${error}`: view.help;@@ -106,7 +110,7 @@ export function RealtimeMichaelToggle({ compact = false }: RealtimeMichaelToggle<spantitle={title}className="cth-titlebar-nodrag"- style={{ display: 'inline-flex' }}+ style={{ display: 'inline-flex', alignItems: 'center', gap: noKey ? 6 : 0 }}// Stop the click bubbling to a parent card's onClick (selecting the agent).onClick={(e) => e.stopPropagation()}>@@ -141,6 +145,30 @@ export function RealtimeMichaelToggle({ compact = false }: RealtimeMichaelToggle)}</span></PixelButton>+ {/* Inline, non-blocking caution chip — a discoverable cue for WHY the disabled+ button won't connect (the native tooltip is hover-only). Only when no key is+ set; once a key is added the store signal flips and this disappears. Compact+ form (fullscreen toolbar) keeps it short to avoid crowding the header. */}+ {noKey && (+ <span+ aria-label="Talk needs an OpenAI key"+ style={{+ display: 'inline-flex',+ alignItems: 'center',+ whiteSpace: 'nowrap',+ fontFamily: 'var(--cth-font-ui)',+ fontSize: 10,+ lineHeight: '14px',+ padding: '1px 5px 0',+ background: 'var(--cth-lemon)',+ color: 'var(--cth-ink-900)',+ boxShadow: 'inset 0 0 0 1px var(--cth-ink-900)',+ flexShrink: 0+ }}+ >+ {compact ? 'needs OpenAI key' : 'needs OpenAI key · Settings'}+ </span>+ )}</span>);}diff --git a/src/renderer/src/components/SettingsModal.tsx b/src/renderer/src/components/SettingsModal.tsxindex ff3b9dcb..eb49939c 100644--- a/src/renderer/src/components/SettingsModal.tsx+++ b/src/renderer/src/components/SettingsModal.tsx@@ -242,6 +242,9 @@ export function SettingsModal({ config, onClose }: SettingsModalProps) {// --- Free Flow (voice dictation → message queue) ---const setFreeflowEnabledStore = useStore((s) => s.setFreeflowEnabled);const setHasGroqKeyStore = useStore((s) => s.setHasGroqKey);+ // Talk (Realtime Michael) is gated on the OpenAI key — read the live presence+ // boolean so the Realtime Michael section can show its enabled/disabled status.+ const hasOpenAiKey = useStore((s) => s.hasOpenAiKey);const [freeflowEnabled, setFreeflowEnabled] = useState(slackCfg.freeflowEnabled ?? false);const [groqKey, setGroqKey] = useState(slackCfg.groqApiKey ?? '');const [freeflowModel, setFreeflowModel] = useState(slackCfg.freeflowModel ?? 'whisper-large-v3-turbo');@@ -1234,6 +1237,46 @@ export function SettingsModal({ config, onClose }: SettingsModalProps) {microphone and speaker the voice loop uses here.</span></div>++ {/* OpenAI Realtime key — its own documented requirement. Talk mints an+ ephemeral token from your OpenAI key (the same OpenAI provider key+ under AI Engines), distinct from your Anthropic key. The status line+ reads the live presence boolean (key value never leaves main). */}+ <div style={{+ display: 'flex', flexDirection: 'column', gap: 6,+ padding: 10,+ background: 'var(--cth-paper-100)',+ boxShadow: 'inset 0 0 0 1px var(--cth-ink-300)'+ }}>+ <span style={{+ fontFamily: 'var(--cth-font-display)', fontSize: 8, lineHeight: '12px',+ color: 'var(--cth-ink-500)', textTransform: 'uppercase'+ }}>+ OpenAI Realtime key+ </span>+ <span style={{ fontSize: 12, lineHeight: '17px', color: 'var(--cth-ink-700)' }}>+ Talk uses OpenAI’s Realtime voice API, so it needs your <strong>OpenAI API key</strong> —+ the same key you set under <strong>AI Engines → OpenAI</strong>. It is a separate provider+ key from your Anthropic key. Main mints a short-lived token from it for each session; the+ key itself never leaves your machine. <strong>Without an OpenAI key the Talk button stays+ disabled.</strong>+ </span>+ <span style={{+ display: 'inline-flex', alignItems: 'center', gap: 6,+ fontSize: 12, lineHeight: '16px',+ color: hasOpenAiKey ? 'var(--cth-ink-900)' : '#6E1423'+ }}>+ <span aria-hidden style={{+ width: 8, height: 8, flexShrink: 0,+ background: hasOpenAiKey ? 'var(--cth-mint)' : 'var(--cth-lemon)',+ boxShadow: 'inset 0 0 0 1px var(--cth-ink-900)'+ }} />+ {hasOpenAiKey+ ? 'OpenAI key detected — Talk is enabled.'+ : 'No OpenAI key set — Talk is disabled. Add it under AI Engines → OpenAI.'}+ </span>+ </div>+<RealtimeDevicePicker /><CostHud />{/* rt-9 idle-tunable: how long an idle voice session stays open before