Skip to content

retro: update CLAUDE.md rules#964

Open
c-reichert wants to merge 9 commits intoslopus:mainfrom
c-reichert:retro/updates-20260402-133955
Open

retro: update CLAUDE.md rules#964
c-reichert wants to merge 9 commits intoslopus:mainfrom
c-reichert:retro/updates-20260402-133955

Conversation

@c-reichert
Copy link
Copy Markdown

Retro discovered 1 rule(s) from your sessions.

Approved via retro dash.

This commit captures the working ElevenLabs voice integration with full
multi-session routing support. This is the stable baseline before
migrating to OpenAI Realtime.

WHAT'S IN THIS COMMIT:

realtimeClientTools.ts
- Complete rewrite to support multi-session routing
- Added resolveSessionId() fuzzy matcher (folder name → partial → summary → ID prefix)
- messageClaudeCode and processPermissionRequest now require 'session' param (not optional)
- Added new switchSession tool for explicit tab switching
- Removed auto-navigate on messageClaudeCode (was defocusing user mid-drive)

voiceHooks.ts / contextFormatters.ts
- onVoiceStarted() now builds initial context covering ALL active sessions
- getSessionLabel() returns folder name (short, stable, voice-friendly)
- Session roster uses folder names throughout, not raw IDs

RealtimeVoiceSession.tsx / .web.tsx
- On connect: immediately pushes full session roster via sendContextualUpdate
  so agent knows all sessions from the moment voice connects
- Uses getSessionLabel() for human-readable session names

index.ts
- Added LogBox.ignoreAllLogs(true) to suppress 15 pre-existing RN warnings
  that were freezing all UI interaction on the iPhone

docs/elevenlabs-agent-setup.md (new)
- Full setup guide for the ElevenLabs agent
- System prompt with {{initialConversationContext}} dynamic variable injection
- SILENCE BEHAVIOR section: agent must NOT fill silence (driving use case)
- All 3 tool JSON schemas (messageClaudeCode, processPermissionRequest, switchSession)
- Dynamic variable setup instructions, silence/inactivity settings
13-task plan to replace ElevenLabs SDK with custom WebRTC client
connecting to OpenAI Realtime API (gpt-realtime GA). Key design:
- VoiceSession interface is the abstraction boundary
- OpenAIRealtimeClient class (~200 LOC) handles WebRTC + data channel
- Tool translator bridges existing realtimeClientTools to OpenAI format
- System prompt moves from ElevenLabs dashboard to code
- Spike task gates everything to prove DataChannel works first
- Includes ICE recovery and 30-min session auto-reconnect for driving
Custom WebRTC client connecting to OpenAI gpt-realtime via
RTCPeerConnection and RTCDataChannel. Uses livekit react-native-webrtc
which is already installed and proven via spike test.

Changes: OpenAIRealtimeClient, tool translator, system prompt in code,
RealtimeVoiceSession swapped, RealtimeProvider simplified, RealtimeSession
updated for API key flow, semantic VAD with eagerness low for driving.
Use mediaDevices from @livekit/react-native-webrtc instead of
navigator.mediaDevices (which doesn't exist in React Native).
Also update default model to gpt-realtime-1.5.
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