Skip to content

Update OpenAI voice runtime and restore packaged microphone access - #170

Merged
pmbstyle merged 2 commits into
mainfrom
agent/openai-voice-runtime-update
Aug 4, 2026
Merged

Update OpenAI voice runtime and restore packaged microphone access#170
pmbstyle merged 2 commits into
mainfrom
agent/openai-voice-runtime-update

Conversation

@pmbstyle

@pmbstyle pmbstyle commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • upgrade the OpenAI JavaScript SDK to 7.4.0 and move CI/runtime requirements to Node.js 22
  • switch OpenAI speech synthesis to gpt-4o-mini-tts and expose the current OpenAI voice set
  • use gpt-5.6-luna as the default summarization model while preserving saved user configuration
  • treat OpenAI SDK APIUserAbortError as an expected cancellation across chat, tool, stream, video, and TTS flows
  • add the macOS audio-input entitlement to the signed app and inherited Electron helpers

Why

The hardened packaged macOS app could initialize VAD but macOS TCC denied microphone capture because the signed bundle lacked com.apple.security.device.audio-input. Development builds were unaffected, which made the failure appear to be in VAD or STT.

The SDK update also changed the user-initiated abort error type, so cancellation handling now recognizes both browser AbortError and OpenAI APIUserAbortError.

Impact

Installed macOS builds can request and receive microphone access, allowing audio to reach VAD and STT. OpenAI TTS uses the newer speech model and voices, and new/default OpenAI summarization configuration uses gpt-5.6-luna.

Validation

  • npm test — 26 files, 124 tests passed
  • npx vue-tsc --noEmit
  • plutil -lint build/entitlements.mac.plist
  • git diff --check
  • production Electron/Vite build completed
  • app signature verified with codesign --verify --deep --strict
  • audio-input entitlement verified on the main app and Electron helpers
  • DMG verified with hdiutil verify
  • installed build smoke-tested successfully by the user

Summary by CodeRabbit

  • New Features

    • Added seven OpenAI text-to-speech voices: Ash, Ballad, Coral, Sage, Verse, Marin, and Cedar.
    • Updated the default summarization model to GPT-5.6 Luna.
    • Improved macOS audio and application compatibility.
  • Bug Fixes

    • Expected cancellations during streaming, speech playback, reminders, and video playback no longer produce unnecessary errors or warnings.
    • Improved handling of interrupted conversations while preserving reporting for genuine failures.
  • Tests

    • Expanded coverage for multiple cancellation scenarios across conversation and speech features.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 897c8f87-1650-45e1-af8d-c0d94bca9761

📥 Commits

Reviewing files that changed from the base of the PR and between 0e964d2 and 2cd40dc.

📒 Files selected for processing (1)
  • electron-builder.json5
🚧 Files skipped from review as they are similar to previous changes (1)
  • electron-builder.json5

📝 Walkthrough

Walkthrough

The pull request updates Node.js and macOS build configuration, adds OpenAI voices and model settings, changes OpenAI request parameters, and centralizes handling for AbortError and APIUserAbortError.

Changes

Platform runtime configuration

Layer / File(s) Summary
Node.js and macOS packaging
.github/workflows/build.yml, package.json, build/entitlements.mac.plist, electron-builder.json5
Builds and package metadata require Node.js 22. macOS packaging references entitlements for JIT, unsigned executable memory, library validation, and audio input.

OpenAI models and voices

Layer / File(s) Summary
Model and voice settings
electron/main/settingsManager.ts, src/stores/settingsStore.ts, src/components/settings/CoreSettingsTab.vue, src/components/settings/AssistantSettingsTab.vue, src/components/wizard/OnboardingWizard.vue
Settings support seven additional TTS voices. The default and displayed summarization model is now gpt-5.6-luna.
OpenAI request configuration
package.json, src/services/apiService.ts
The OpenAI package uses version ^7.4.0. TTS uses gpt-4o-mini-tts. GPT-5.6 summarization and context analysis use none reasoning effort.

Expected abort handling

Layer / File(s) Summary
Shared abort classification
src/utils/isAbortError.ts
Added isExpectedAbortError, which recognizes AbortError and APIUserAbortError.
Conversation and stream cancellation paths
src/modules/conversation/..., src/services/llmProviders/streamAdapters.ts, src/stores/conversationStore.ts, src/stores/generalStore.ts
Conversation, stream, reminder, TTS, context-action, and video playback paths now suppress recognized abort errors and retain existing handling for other errors.
Abort behavior tests
src/modules/conversation/__tests__/*
Parameterized tests cover both supported abort error names and verify that cancellation does not log or invoke stream-error handling.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OpenAI
  participant StreamAdapters
  participant ConversationHandlers
  participant ConversationStore
  OpenAI->>StreamAdapters: Return stream abort error
  StreamAdapters->>ConversationHandlers: Classify error
  ConversationHandlers->>ConversationStore: Suppress expected abort
  ConversationHandlers->>ConversationStore: Log unexpected error
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the OpenAI voice changes and packaged macOS microphone access addressed by the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/openai-voice-runtime-update

Comment @coderabbitai help to get the list of available commands.

@socket-security

socket-security Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​openai@​6.33.0 ⏵ 7.4.078 +1100100 +1100 +1100

View full report

@pmbstyle pmbstyle self-assigned this Aug 4, 2026
@pmbstyle
pmbstyle marked this pull request as ready for review August 4, 2026 12:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/services/apiService.ts (1)

801-812: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use model-specific reasoning effort values. The OpenAI model list allows gpt-5.1, gpt-5.2, gpt-5.4, and gpt-5.5, but these models do not support minimal; requests can fail. Apply the fix to both createSummarizationResponse and createContextAnalysisResponse.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/services/apiService.ts` around lines 801 - 812, Update the model-specific
reasoning configuration in both createSummarizationResponse and
createContextAnalysisResponse so gpt-5.1, gpt-5.2, gpt-5.4, and gpt-5.5 use
supported effort values instead of minimal. Preserve the existing special
handling for gpt-5.6 and ensure all gpt-5 model branches send a valid reasoning
effort.
🧹 Nitpick comments (2)
src/modules/conversation/toolCallHandler.ts (2)

79-85: 🎯 Functional Correctness | 🔵 Trivial

Add the signal.aborted fallback used elsewhere for cancellation handling.

handleToolCall creates its own abortController at line 64 and passes abortController.signal to createOpenAIResponse. The catch blocks at lines 83 and 105 check only isExpectedAbortError(error). chatOrchestrator.ts and speechQueue.ts check both abortController.signal.aborted and isExpectedAbortError(error) for the same kind of cancellation.

If a provider rethrows a cancellation as an error without the expected name, this handler falls through to dependencies.logError and shows an error message during an intentional cancellation. Add the same fallback check for consistency with the other cancellation paths.

Also applies to: 98-111

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/modules/conversation/toolCallHandler.ts` around lines 79 - 85, Update
both catch blocks in handleToolCall, including the continuation attempt and
response creation error paths, to treat abortController.signal.aborted as
cancellation alongside isExpectedAbortError(error). Preserve the existing
early-return behavior so intentional cancellations do not reach
dependencies.logError or display an error message.

79-111: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Missing signal.aborted fallback in two cancellation paths that own an AbortController. Both sites create a dedicated AbortController, pass its signal into createOpenAIResponse, and check only isExpectedAbortError(error) in the catch block. chatOrchestrator.ts's runChat (line 457) and speechQueue.ts's enqueueSpeech (line 46) check signal.aborted in addition to isExpectedAbortError(error) for the same kind of cancellation, so these two sites are inconsistent with the rest of the cancellation handling this PR introduces.

  • src/modules/conversation/toolCallHandler.ts#L79-L111: add abortController.signal.aborted || before isExpectedAbortError(error) in the catch blocks at lines 83 and 105.
  • src/stores/conversationStore.ts#L987-L1018: add llmAbortController.value?.signal.aborted || before isExpectedAbortError(error) in the catch block at line 998.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/modules/conversation/toolCallHandler.ts` around lines 79 - 111, Add the
owning AbortController signal-aborted check to the cancellation conditions in
the catch blocks at src/modules/conversation/toolCallHandler.ts lines 79-111,
covering both the initial and retry continuation paths, before
isExpectedAbortError(error). Also update the catch block at
src/stores/conversationStore.ts lines 987-1018 to check
llmAbortController.value?.signal.aborted before isExpectedAbortError(error),
preserving existing handling for non-cancellation errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@build/entitlements.mac.plist`:
- Around line 11-12: Add the mac.extendInfo.NSMicrophoneUsageDescription entry
to the entitlements configuration with a clear microphone-access explanation,
alongside the existing com.apple.security.device.audio-input permission.

---

Outside diff comments:
In `@src/services/apiService.ts`:
- Around line 801-812: Update the model-specific reasoning configuration in both
createSummarizationResponse and createContextAnalysisResponse so gpt-5.1,
gpt-5.2, gpt-5.4, and gpt-5.5 use supported effort values instead of minimal.
Preserve the existing special handling for gpt-5.6 and ensure all gpt-5 model
branches send a valid reasoning effort.

---

Nitpick comments:
In `@src/modules/conversation/toolCallHandler.ts`:
- Around line 79-85: Update both catch blocks in handleToolCall, including the
continuation attempt and response creation error paths, to treat
abortController.signal.aborted as cancellation alongside
isExpectedAbortError(error). Preserve the existing early-return behavior so
intentional cancellations do not reach dependencies.logError or display an error
message.
- Around line 79-111: Add the owning AbortController signal-aborted check to the
cancellation conditions in the catch blocks at
src/modules/conversation/toolCallHandler.ts lines 79-111, covering both the
initial and retry continuation paths, before isExpectedAbortError(error). Also
update the catch block at src/stores/conversationStore.ts lines 987-1018 to
check llmAbortController.value?.signal.aborted before
isExpectedAbortError(error), preserving existing handling for non-cancellation
errors.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 50aee353-9708-4f7c-95e0-6bb4862f8a0b

📥 Commits

Reviewing files that changed from the base of the PR and between 968d821 and 0e964d2.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (22)
  • .github/workflows/build.yml
  • build/entitlements.mac.plist
  • electron-builder.json5
  • electron/main/settingsManager.ts
  • package.json
  • src/components/settings/AssistantSettingsTab.vue
  • src/components/settings/CoreSettingsTab.vue
  • src/components/wizard/OnboardingWizard.vue
  • src/modules/conversation/__tests__/chatOrchestrator.test.ts
  • src/modules/conversation/__tests__/speechQueue.test.ts
  • src/modules/conversation/__tests__/streamHandler.test.ts
  • src/modules/conversation/chatOrchestrator.ts
  • src/modules/conversation/reminderHandler.ts
  • src/modules/conversation/speechQueue.ts
  • src/modules/conversation/streamHandler.ts
  • src/modules/conversation/toolCallHandler.ts
  • src/services/apiService.ts
  • src/services/llmProviders/streamAdapters.ts
  • src/stores/conversationStore.ts
  • src/stores/generalStore.ts
  • src/stores/settingsStore.ts
  • src/utils/isAbortError.ts

Comment thread build/entitlements.mac.plist
@pmbstyle
pmbstyle merged commit 69c6d83 into main Aug 4, 2026
6 checks passed
@pmbstyle
pmbstyle deleted the agent/openai-voice-runtime-update branch August 4, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant