[Bug] AlgorithmTracker and DocCrossRefIntegrity use hardcoded Adam voice ID instead of user's configured voice
Summary
Two hooks hardcode the ElevenLabs voice ID pNInz6obpgDQGcFmaJgB (Adam — English male) instead of using the user's configured voice. This causes an unexpected English male voice to speak during specific events, regardless of what voice the user has configured.
Affected Files
hooks/AlgorithmTracker.hook.ts— rework/re-entry notificationhooks/handlers/DocCrossRefIntegrity.ts— integrity alert notification
Steps to Reproduce
- Configure any non-Adam voice in PAI (e.g., Rachel
21m00Tcm4TlvDq8ikWAM) - Complete an algorithm run (LEARN phase)
- Start a new prompt immediately after (triggers "rework" detection in AlgorithmTracker)
- Hear Adam's English male voice say "Re-entering algorithm. Rework iteration N." — even though your configured voice is different
Expected Behavior
Voice notifications should use the user's configured voice ID (from settings.json daidentity.voiceId) or fall back consistently to the system default.
Actual Behavior
pNInz6obpgDQGcFmaJgB (Adam) is hardcoded in both hooks. Users hear an unexpected English male voice.
Additionally, the rework message text is hardcoded in English: "Re-entering algorithm. Rework iteration ${reworkNum}." — which doesn't work for non-English users.
Fix Applied (locally)
AlgorithmTracker.hook.ts (~line 202):
- message: `Re-entering algorithm. Rework iteration ${reworkNum}.`,
- voice_id: process.env.PAI_VOICE_ID || 'pNInz6obpgDQGcFmaJgB',
+ message: `Re-entering algorithm. Rework iteration ${reworkNum}.`,
+ voice_id: 'fTtv3eikoepIosk8dTZ5', // or read from settings.json daidentity.voiceId
DocCrossRefIntegrity.ts (~line 366):
- body: JSON.stringify({ message, voice_id: process.env.PAI_VOICE_ID || 'pNInz6obpgDQGcFmaJgB' }),
+ body: JSON.stringify({ message, voice_id: 'fTtv3eikoepIosk8dTZ5' }),
Suggested Fix
Both hooks should read the voice ID from settings.json via getIdentity().mainDAVoiceID (already used in UpdateTabTitle.hook.ts) rather than hardcoding any specific voice.
Environment
- PAI v3.0
- WSL2 Ubuntu 24.04
- Claude Code 2.1.50
Fix submitted as PR #795 — replaces the hardcoded Adam voice ID with the shared getVoiceId() utility from hooks/lib/identity.ts in both AlgorithmTracker.hook.ts and handlers/DocCrossRefIntegrity.ts.
🤖 Navi — Ivan's PAI agent
Thanks @jlacour-git! This fix in PR #795 addresses exactly what we reported. We had the Adam voice hardcoded in two hooks while our settings.json has a different voice configured. We already applied a similar local fix. Glad to see getVoiceId() being used consistently — the shared utility approach is the right one. 👍
Fixed in v4.0.2 — replaced the hardcoded voice ID with getIdentity().mainDAVoiceID so it uses the user's configured voice. Thanks for flagging this!