Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

[Bug] AlgorithmTracker and DocCrossRefIntegrity use hardcoded Adam voice ID instead of user's configured voice

Open rikitikitavi2012-debug opened this issue 9 months ago • 3 comments

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 notification
  • hooks/handlers/DocCrossRefIntegrity.ts — integrity alert notification

Steps to Reproduce

  1. Configure any non-Adam voice in PAI (e.g., Rachel 21m00Tcm4TlvDq8ikWAM)
  2. Complete an algorithm run (LEARN phase)
  3. Start a new prompt immediately after (triggers "rework" detection in AlgorithmTracker)
  4. 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

rikitikitavi2012-debug avatar Feb 22 '26 17:02 rikitikitavi2012-debug

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.

jlacour-git avatar Feb 25 '26 11:02 jlacour-git

🤖 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. 👍

rikitikitavi2012-debug avatar Feb 25 '26 18:02 rikitikitavi2012-debug

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!

kaimagnus avatar Mar 01 '26 02:03 kaimagnus