Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(live-voice): polish the Live Voice settings page
vastsa8973dab84abb
diff --git a/apps/desktop/src/features/settings/primitives.tsx b/apps/desktop/src/features/settings/primitives.tsxindex 28e7bbbfa..3a025f9a0 100644--- a/apps/desktop/src/features/settings/primitives.tsx+++ b/apps/desktop/src/features/settings/primitives.tsx@@ -53,15 +53,20 @@ export function SettingsRow({/*** A titled group of rows. `description` follows the same rule as a row's: it- * explains the card, so it lives behind the heading's help icon.+ * explains the card, so it lives behind the heading's help icon. `action` is a+ * card-level control (for example a link to another Settings destination) and+ * belongs on the heading line, not among the rows.*/export function SettingsCard({title,description,+ action,children,}: {title?: string;description?: string;+ /** Card-level control rendered at the end of the heading line. */+ action?: ReactNode;children: ReactNode;}) {return (@@ -72,9 +77,18 @@ export function SettingsCard({button joins the heading's accessible name, and a screen reader'slist of headings should not read out every explanation.*/- <div className="settings-card-heading-help">- <h3 className="settings-card-heading">{title}</h3>- {description ? <HelpIcon label={description} /> : null}+ <div+ className={+ action+ ? "settings-card-heading-row settings-card-heading-with-action"+ : "settings-card-heading-help"+ }+ >+ <div className="settings-card-heading-help">+ <h3 className="settings-card-heading">{title}</h3>+ {description ? <HelpIcon label={description} /> : null}+ </div>+ {action}</div>) : null}<div className="settings-panel">{children}</div>diff --git a/apps/desktop/src/features/settings/voice/LiveVoiceSettings.tsx b/apps/desktop/src/features/settings/voice/LiveVoiceSettings.tsxindex 0d99fd132..e86ff21db 100644--- a/apps/desktop/src/features/settings/voice/LiveVoiceSettings.tsx+++ b/apps/desktop/src/features/settings/voice/LiveVoiceSettings.tsx@@ -151,20 +151,18 @@ export function LiveVoiceSettings({/></SettingsRow>) : null}- {adapter !== "codex-live" ? (+ {current && adapter !== "codex-live" ? (<SettingsRow title={t("liveVoice.model")}><Inputaria-label={t("liveVoice.model")}- value={current ? drafts[current.id]?.modelId ?? ("modelId" in current ? current.modelId : "") : ""}- disabled={!current || saving || locked}+ value={drafts[current.id]?.modelId ?? ("modelId" in current ? current.modelId : "")}+ disabled={saving || locked}maxLength={160}onChange={(event) => {- if (!current) return;const modelId = event.currentTarget.value;setDrafts((all) => ({ ...all, [current.id]: { ...all[current.id], modelId } }));}}onBlur={(event) => {- if (!current) return;const modelId = event.currentTarget.value.trim();if (modelId) void updateBinding(adapter, { modelId }).finally(() => setDrafts((all) => { const next = { ...all }; delete next[current.id]; return next; }));else setDrafts((all) => { const next = { ...all }; delete next[current.id]; return next; });@@ -172,31 +170,31 @@ export function LiveVoiceSettings({/></SettingsRow>) : null}- <SettingsRow title={t("liveVoice.voice")}>- <Input- aria-label={t("liveVoice.voice")}- value={current ? drafts[current.id]?.voice ?? current.voice : ""}- disabled={!current || saving || locked}- maxLength={64}- onChange={(event) => {- if (!current) return;- const voice = event.currentTarget.value;- setDrafts((all) => ({ ...all, [current.id]: { ...all[current.id], voice } }));- }}- onBlur={(event) => {- if (!current) return;- const voice = event.currentTarget.value.trim();- if (voice) void updateBinding(adapter, { voice }).finally(() => setDrafts((all) => { const next = { ...all }; delete next[current.id]; return next; }));- else setDrafts((all) => { const next = { ...all }; delete next[current.id]; return next; });- }}- />- </SettingsRow>- {adapter === "openai-realtime" ? (+ {current ? (+ <SettingsRow title={t("liveVoice.voice")}>+ <Input+ aria-label={t("liveVoice.voice")}+ value={drafts[current.id]?.voice ?? current.voice}+ disabled={saving || locked}+ maxLength={64}+ onChange={(event) => {+ const voice = event.currentTarget.value;+ setDrafts((all) => ({ ...all, [current.id]: { ...all[current.id], voice } }));+ }}+ onBlur={(event) => {+ const voice = event.currentTarget.value.trim();+ if (voice) void updateBinding(adapter, { voice }).finally(() => setDrafts((all) => { const next = { ...all }; delete next[current.id]; return next; }));+ else setDrafts((all) => { const next = { ...all }; delete next[current.id]; return next; });+ }}+ />+ </SettingsRow>+ ) : null}+ {current && adapter === "openai-realtime" ? (<SettingsRow title={t("liveVoice.profile")}><SettingsMenuSelect- value={current?.adapterId === "openai-realtime" ? current.wireProfile : "realtime-ga"}+ value={current.adapterId === "openai-realtime" ? current.wireProfile : "realtime-ga"}label={t("liveVoice.profile")}- disabled={!current || saving || locked}+ disabled={saving || locked}options={[{ id: "realtime-ga", label: t("liveVoice.profiles.realtime-ga") },{ id: "realtime-compat-v1", label: t("liveVoice.profiles.realtime-compat-v1") },@@ -212,7 +210,22 @@ export function LiveVoiceSettings({return (<div className="settings-stack voice-settings live-voice-settings">- <SettingsCard title={t("liveVoice.title")} description={t("liveVoice.description")}>+ <SettingsCard+ title={t("liveVoice.title")}+ description={t("liveVoice.description")}+ action={+ /* Model configuration owns provider accounts and login, so the+ card's link to it sits on the heading line rather than among the+ rows above the enable switch. */+ <Button+ variant="ghost"+ className="settings-text-action"+ onClick={() => setSettingsTab("agent")}+ >+ {t("settings.configuration")}+ </Button>+ }+ ><SettingsRow title={t("liveVoice.enable")} description={t("liveVoice.enableDetail")}><SettingsTogglechecked={live.enabled}@@ -230,11 +243,6 @@ export function LiveVoiceSettings({</Button></div>) : null}- <div className="live-voice-actions">- <Button size="sm" variant="secondary" onClick={() => setSettingsTab("agent")}>- {t("settings.nav.models")}- </Button>- </div>{saveFailed ? <div className="live-voice-error" role="alert">{t("liveVoice.saveFailed")}</div> : null}</SettingsCard>{renderAdapter("codex-live")}diff --git a/apps/desktop/src/lib/settings-search.ts b/apps/desktop/src/lib/settings-search.tsindex 9d7d325aa..5099ce4fa 100644--- a/apps/desktop/src/lib/settings-search.ts+++ b/apps/desktop/src/lib/settings-search.ts@@ -131,7 +131,6 @@ export const SETTINGS_NAV: SettingsNavEntry[] = [labelKey: "liveVoice.title",titleKey: "liveVoice.title",group: "preferences",- experimentalBadgeKey: "settings.voiceExperimental",keywordKeys: ["liveVoice.title","liveVoice.description",diff --git a/apps/desktop/src/styles/settings.css b/apps/desktop/src/styles/settings.cssindex 453135e9c..10a61490d 100644--- a/apps/desktop/src/styles/settings.css+++ b/apps/desktop/src/styles/settings.css@@ -359,10 +359,35 @@}/* The heading's help mark sits beside the heading rather than inside it: a- nested button would join the heading's accessible name. */+ nested button would join the heading's accessible name.+ The 10px gap below the heading belongs to this flex row: a margin inside it+ would extend the icon's centering box and lift the question mark off the+ heading text. */.settings-card-heading-help {display: flex;align-items: center;+ margin-bottom: 10px;+}++.settings-card-heading-help .settings-card-heading {+ margin-bottom: 0;+}++/* A card heading that carries a card-level action keeps heading, help mark and+ action on one line, centered on each other. */+.settings-card-heading-row.settings-card-heading-with-action {+ align-items: center;+}++.settings-card-heading-row.settings-card-heading-with-action .settings-card-heading-help {+ min-width: 0;+ margin-bottom: 0;+}++.settings-card-heading-row.settings-card-heading-with-action+ .settings-card-heading-help+ .settings-card-heading {+ margin-bottom: 0;}.settings-card-heading-row {diff --git a/apps/desktop/test/settings-developer-only-destinations.test.mjs b/apps/desktop/test/settings-developer-only-destinations.test.mjsindex 9cb8e725a..400a2af15 100644--- a/apps/desktop/test/settings-developer-only-destinations.test.mjs+++ b/apps/desktop/test/settings-developer-only-destinations.test.mjs@@ -30,6 +30,18 @@ const composerToolbar = readFileSync("utf8",);+const liveVoiceSettings = readFileSync(+ new URL(+ "../src/features/settings/voice/LiveVoiceSettings.tsx",+ import.meta.url,+ ),+ "utf8",+);+const settingsPrimitives = readFileSync(+ new URL("../src/features/settings/primitives.tsx", import.meta.url),+ "utf8",+);+const identity = (key) => key;const experimentalIds = ["sync", "remoteHosts"];@@ -52,8 +64,12 @@ test("Live Voice is reachable in every build without developer mode", () => {}}}- assert.equal(SETTINGS_NAV.find((entry) => entry.id === "voice")?.experimentalBadgeKey,- "settings.voiceExperimental");+ // Voice is a regular Preferences destination now: no Experimental badge on+ // the rail row or the page title.+ assert.equal(+ SETTINGS_NAV.find((entry) => entry.id === "voice")?.experimentalBadgeKey,+ undefined,+ );});test("developer mode retains the experimental destinations in development", () => {@@ -123,3 +139,15 @@ test("settings routes, global search, and composer use build visibility", () =>assert.match(composerToolbar, /<LiveVoiceControls\b/);assert.doesNotMatch(composerToolbar, /VoiceMicButton|voicePhase|onVoiceToggle|onVoiceCancel/);});++test("Live Voice keeps its Model configuration link on the card heading", () => {+ // The link belongs to the enable card's heading line, not to a floating+ // control inside the row stack.+ assert.match(settingsPrimitives, /settings-card-heading-with-action/);+ assert.match(settingsPrimitives, /action\?: ReactNode/);+ assert.match(+ liveVoiceSettings,+ /action=\{[\s\S]*className="settings-text-action"[\s\S]*settings\.configuration/,+ );+ assert.doesNotMatch(liveVoiceSettings, /live-voice-actions/);+});diff --git a/apps/desktop/test/settings-general.test.mjs b/apps/desktop/test/settings-general.test.mjsindex 0baecd97f..2414066ed 100644--- a/apps/desktop/test/settings-general.test.mjs+++ b/apps/desktop/test/settings-general.test.mjs@@ -526,3 +526,16 @@ test("native select menus keep readable theme colors across the app on Windows",/:root\[data-theme="light"\]\s*\{[^}]*color-scheme:\s*light;/s,);});++test("Live Voice account cards show their options only after a provider is chosen", async () => {+ const source = await readFile(+ new URL("../src/features/settings/voice/LiveVoiceSettings.tsx", import.meta.url),+ "utf8",+ );+ // A card with no provider account bound is the picker and nothing else: the+ // model, voice, and protocol rows belong to a chosen binding instead of+ // rendering as empty disabled controls.+ assert.match(source, /\{current && adapter !== "codex-live" \? \(/);+ assert.match(source, /\{current && adapter === "openai-realtime" \? \(/);+ assert.doesNotMatch(source, /disabled=\{!current/);+});diff --git a/docs/spec/03-runtime/live-voice.md b/docs/spec/03-runtime/live-voice.mdindex 12f2e1088..94e0b43b4 100644--- a/docs/spec/03-runtime/live-voice.md+++ b/docs/spec/03-runtime/live-voice.md@@ -130,9 +130,9 @@ stops all local tracks, playback and ports before releasing the lease.## Settings and compatibility-Voice is available in both development and packaged builds without developer-mode. Its Experimental badge remains an availability caveat, not an access-restriction. Live Voice remains off by default, and enabling the setting does+Voice is a regular Preferences destination in both development and packaged+builds: no Experimental badge, no developer mode, no build gate. Live Voice+remains off by default, and enabling the setting doesnot start microphone capture. Composer offers an Open settings action whensetup or account recovery is needed. Cloud sync and Remote Hosts retain theirseparate development-only gates.@@ -140,15 +140,19 @@ separate development-only gates.Account-list loading, failure with explicit retry, and an empty compatibleaccount list are distinct states. A loading failure never clears saved bindings.The settings page links to the existing Model configuration destination for-account login and management. Call errors distinguish missing authentication,+account login and management, from the enable card's heading line rather than+from a control among its rows. Call errors distinguish missing authentication,account access denial, unsupported protocol, network/rate limits and microphonefailures without displaying provider response content or credentials.The Voice settings destination exposes only Live Voice: users can bind anexisting compatible Provider, choose the next-call binding, and set model, voice-and Realtime profile. A currently active binding cannot be rewritten while its-call is running. Turning Live Voice off ends the call. Provider credentials stay-in the existing Provider/secret or VendorOAuth systems. Legacy local Dictation+and Realtime profile. An account card with no bound provider shows only its+picker; the next-call, model, voice and profile rows appear with the binding+rather than as empty disabled controls. A currently active binding cannot be+rewritten while its call is running. Turning Live Voice off ends the call.+Provider credentials stay in the existing Provider/secret or VendorOAuth+systems. Legacy local Dictationsettings and its Composer entry are hidden; existing `voice` values and theunderlying Dictation capability remain unchanged and are not deleted or rewrittenby the UI. Old settings with no `liveVoice` value read as disabled with nodiff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.mdindex a633fd109..e621bb801 100644--- a/docs/spec/04-ux/06-settings-ia.md+++ b/docs/spec/04-ux/06-settings-ia.md@@ -70,10 +70,10 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (lines are rendered. These are visual landmarks only, not a second navigationlevel.When search filters the directory, empty clusters and their headings disappear.-- **Voice** is an Experimental Preferences destination between AI and- Shortcuts, present only in development builds while developer mode is on.- Its existing build/developer gate applies to the rail, page, search hits,- and idle Composer entry; this interaction redesign does not widen access.+- **Voice** is a regular Preferences destination between AI and Shortcuts,+ present in every build with no Experimental badge and no developer-mode+ requirement. Its rail row, page, search hits, and idle Composer entry are+ available to all users.It is the only place to enable Live Voice. See the Voice section below.- **Cloud sync / 云同步** is a developer-only, Experimental destination: itsrail row, page, and settings-search hits exist only while@@ -299,17 +299,22 @@ The user-facing dashboard is marketplace plugin `pi.token-insights`, opened fromthe command palette (`usage`, `tokens`, `用量`). Settings search does not indexa usage tab.-### Voice (experimental)+### Voice-- This development-build and developer-mode gated destination owns Live Voice- enablement and provider bindings. Disabled Live Voice has no Composer voice- or work icon; enabling it reveals one preparation entry, never auto-starts a- call, and never grants work access.+- This destination owns Live Voice enablement and provider bindings, and is+ reachable in every build without developer mode. Its enable card keeps the+ explanation behind the heading's help mark and the Model configuration link+ on the card's heading line, so no control floats between the rows. Disabled+ Live Voice has no Composer voice or work icon; enabling it reveals one+ preparation entry, never auto-starts a call, and never grants work access.- Bind an existing compatible provider account, choose the exact next-callbinding, and configure its model, voice, and explicit Realtime profile where- applicable. Readiness describes that selected binding, not whether any other- configured provider is ready. Credentials remain in the existing Host/Main- systems and are not shown or copied into the renderer.+ applicable. An account card with nothing bound shows only its picker: the+ next-call, model, voice, and profile rows appear with the binding instead of+ rendering as empty disabled controls. Readiness describes that selected+ binding, not whether any other configured provider is ready. Credentials+ remain in the existing Host/Main systems and are not shown or copied into the+ renderer.- Provider-binding edits remain locked while that binding is active. TurningLive Voice off ends the call, but the global compact call bar remains visiblethrough Main termination and renderer media cleanup, including while Settingsdiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 82f4403a1..f4a6fe098 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -72,13 +72,16 @@### E2E-LIVE-VOICE-four-stage-ui- **Title:** Disabled, preparation, compact call, and deliberate details.-- **Preconditions:** Isolated development-build Electron profile with developer- mode on, Live Voice initially disabled, deterministic local provider/media- fixtures, and local work-session fixtures. No real account, microphone,- speaker, paid endpoint, or user's running Desktop instance is used.+- **Preconditions:** Isolated Electron profile with Live Voice initially+ disabled, deterministic local provider/media fixtures, and local work-session+ fixtures. No real account, microphone, speaker, paid endpoint, or user's+ running Desktop instance is used.- **Steps:**- 1. Confirm neither Live nor Work Composer icon exists while disabled. Enable- Live Voice only from Settings → Voice; verify exactly one idle voice icon.+ 1. Confirm neither Live nor Work Composer icon exists while disabled. Every+ account card shows only its provider picker until that account is bound.+ Enable Live Voice only from Settings → Voice; verify exactly one idle+ voice icon and that the card keeps its Model configuration link on the+ heading line beside the help mark.2. Open preparation and expand/collapse work options without starting. Verifyno prepare request, microphone acquisition, media initialization, providerconnection, or work dispatch occurs. Make the selected binding unavailable@@ -114,7 +117,7 @@- **Specs:** [Live Voice](../03-runtime/live-voice.md),[Live Work](../03-runtime/live-work-session.md),[Component spec](../04-ux/08-component-spec.md#1171-live-voice-preparation-compact-call-bar-and-details),- [Settings IA](../04-ux/06-settings-ia.md#voice-experimental).+ [Settings IA](../04-ux/06-settings-ia.md#voice).- **Acceptance:** C / E / Security / Quality.- **Milestone:** Post-MVP experimental interaction maintenance.- **Coverage:** Targeted controller/presentation regression tests anddiff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.tsindex 9de904de7..8c8b472e6 100644--- a/packages/i18n/src/locales/de/index.ts+++ b/packages/i18n/src/locales/de/index.ts@@ -915,7 +915,6 @@ sklm: {"shortcutDisable": "Verknüpfung für {{action}} deaktivieren","voice": "Sprache","voiceEnable": "Spracheingabe aktivieren",- "voiceExperimental": "Experimentell","voiceMicrophone": "Mikrofon","voiceSystemDefault": "Systemstandard","voiceLanguages": "Sprachen",diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.tsindex bb017bf01..ce6405619 100644--- a/packages/i18n/src/locales/en/index.ts+++ b/packages/i18n/src/locales/en/index.ts@@ -768,7 +768,6 @@ sklm: {shortcutDisable: "Disable shortcut for {{action}}",voice: "Voice",voiceEnable: "Enable voice input",- voiceExperimental: "Experimental",voiceMicrophone: "Microphone",voiceSystemDefault: "System Default",voiceLanguages: "Languages",diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.tsindex a7fb065e8..bacd38c68 100644--- a/packages/i18n/src/locales/es/index.ts+++ b/packages/i18n/src/locales/es/index.ts@@ -915,7 +915,6 @@ sklm: {"shortcutDisable": "Deshabilitar el acceso directo para {{action}}","voice": "Voz","voiceEnable": "Habilitar entrada de voz",- "voiceExperimental": "Experimental","voiceMicrophone": "Micrófono","voiceSystemDefault": "Predeterminado del sistema","voiceLanguages": "Idiomas",diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.tsindex bc6f3a42f..48411a19e 100644--- a/packages/i18n/src/locales/fr/index.ts+++ b/packages/i18n/src/locales/fr/index.ts@@ -915,7 +915,6 @@ sklm: {"shortcutDisable": "Désactiver le raccourci pour {{action}}","voice": "Voix","voiceEnable": "Activer la saisie vocale",- "voiceExperimental": "Expérimental","voiceMicrophone": "Microphone","voiceSystemDefault": "Par défaut du système","voiceLanguages": "Langues",diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.tsindex 4499c48e0..a413c9f1b 100644--- a/packages/i18n/src/locales/ko/index.ts+++ b/packages/i18n/src/locales/ko/index.ts@@ -923,7 +923,6 @@ sklm: {shortcutDisable: "{{action}} 단축키 비활성화",voice: "음성",voiceEnable: "음성 입력 활성화",- voiceExperimental: "실험적",voiceMicrophone: "마이크",voiceSystemDefault: "시스템 기본값",voiceLanguages: "언어",diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.tsindex 7ec27c0bb..67a1066ff 100644--- a/packages/i18n/src/locales/pt-BR/index.ts+++ b/packages/i18n/src/locales/pt-BR/index.ts@@ -741,7 +741,6 @@ export const ptBR = {shortcutDisable: "Desativar atalho para {{action}}",voice: "Voz",voiceEnable: "Ativar entrada de voz",- voiceExperimental: "Experimental",voiceMicrophone: "Microfone",voiceSystemDefault: "Padrão do sistema",voiceLanguages: "Idiomas",diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.tsindex f64b2851c..87d0879c0 100644--- a/packages/i18n/src/locales/tr/index.ts+++ b/packages/i18n/src/locales/tr/index.ts@@ -913,7 +913,6 @@ sklm: {shortcutDisable: "{{action}} kısayolunu kapat",voice: "Ses",voiceEnable: "Sesli girişi etkinleştir",- voiceExperimental: "Deneysel",voiceMicrophone: "Mikrofon",voiceSystemDefault: "Sistem varsayılanı",voiceLanguages: "Diller",diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.tsindex a861f6089..65f43d893 100644--- a/packages/i18n/src/locales/zh-CN/index.ts+++ b/packages/i18n/src/locales/zh-CN/index.ts@@ -900,7 +900,6 @@ sklm: {shortcutDisable: "禁用“{{action}}”快捷键",voice: "语音",voiceEnable: "启用语音输入",- voiceExperimental: "实验性",voiceMicrophone: "麦克风",voiceSystemDefault: "系统默认",voiceLanguages: "语言",diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.tsindex 6b5c7c7f0..a4511aaff 100644--- a/packages/i18n/src/locales/zh-TW/index.ts+++ b/packages/i18n/src/locales/zh-TW/index.ts@@ -900,7 +900,6 @@ sklm: {shortcutDisable: "停用“{{action}}”快捷鍵",voice: "語音",voiceEnable: "啟用語音輸入",- voiceExperimental: "實驗性",voiceMicrophone: "麥克風",voiceSystemDefault: "系統預設",voiceLanguages: "語言",