Skip to content

Conversation

@jamesrochabrun
Copy link
Owner

@jamesrochabrun jamesrochabrun commented Nov 26, 2025

Summary

  • Fix Realtime API tool_choice.name encoding for specific function - resolves Missing required parameter: 'session.tool_choice.name' error
  • Fix audio engine crash by isolating non-actor code from actor context (ported from Fix for Audio Engine Crash  lzell/AIProxySwift#238)
  • Add support for missing Realtime API message types:
    • response.text.delta / response.text.done (streaming text)
    • response.output_item.added / response.output_item.done
    • response.content_part.added / response.content_part.done
    • conversation.item.created

Test plan

  • Verify Realtime API sessions work with ToolChoice.specific(functionName:)
  • Confirm no crashes when using MicrophonePCMSampleVendorAE
  • Verify new message types are received without "Unhandled message type" warnings

🤖 Generated with Claude Code

jamesrochabrun and others added 6 commits November 25, 2025 22:47
The ToolChoice.specific case was incorrectly encoding the function name
nested inside a "function" object. OpenAI's Realtime API expects "name"
at the root level of tool_choice, not nested.

Before: {"type": "function", "function": {"name": "fn"}}
After:  {"type": "function", "name": "fn"}

This fixes the error: Missing required parameter: 'session.tool_choice.name'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Refactor MicrophonePCMSampleVendorAE to avoid actor isolation issues
by extracting the tap installation into a nonisolated helper method.
This prevents crashes caused by accessing actor-isolated properties
from within the non-actor tap closure.

Ported from: lzell/AIProxySwift#238

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add handling for 7 previously unhandled message types:
- response.text.delta / response.text.done (streaming text)
- response.output_item.added / response.output_item.done
- response.content_part.added / response.content_part.done
- conversation.item.created

These messages are now parsed and yielded through the AsyncStream
instead of being logged as warnings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jamesrochabrun jamesrochabrun merged commit 77cdcb5 into main Nov 26, 2025
3 checks passed
@jamesrochabrun jamesrochabrun deleted the feature/realtime-fixes-and-audio-improvements branch November 26, 2025 07:53
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.

2 participants