Skip to content

feat(relay): fix AI greeting with exact utterance + localized templates#67

Merged
HyeonsangKim merged 1 commit into
mainfrom
feat/fixed-first-greeting
Jul 5, 2026
Merged

feat(relay): fix AI greeting with exact utterance + localized templates#67
HyeonsangKim merged 1 commit into
mainfrom
feat/fixed-first-greeting

Conversation

@sonsangwoo1116

Copy link
Copy Markdown
Contributor

Summary

수신자가 듣는 첫 AI 안내문을 고정 문구(exact utterance)로 전환합니다. 기존에는 인사말이 매 통화 모델 렌더링을 거쳐 문구가 달라졌고, 수신자 응답 직전 발신자 측 소음이 Session A에서 안내문으로 환각되면 "서로 다른 안내문이 2번 나오는" 현상이 발생했습니다 (prod 콜 063d76ac 로그로 확인).

Changes

  • src/prompt/templates.pyFIRST_MESSAGE_TEMPLATES를 수신자 언어(ko/ja/zh/vi) 네이티브 문구로 현지화. 기존엔 전 키가 영어 문장(번역 경로 전제)이라, 이미 exact 모드였던 TextToVoice에서 한국인 수신자에게 영어 인사말이 나가던 잠재 버그도 함께 해소
  • src/prompt/templates.pySESSION_A_RELAY_TEMPLATE의 First Message 섹션이 "번역하라"고 지시하던 모순 제거, verbatim 발화 지시로 교체
  • src/realtime/pipeline/voice_to_voice.pyFirstMessageHandler(use_exact_utterance=True) 적용
  • src/realtime/first_message.pyuse_exact_utterance 기본값 True로 변경 (레거시 재번역 경로가 기본값이 되지 않도록), 레거시 분기에 사용 금지 주석
  • tests/test_first_message.py (신규) + tests/test_voice_to_voice_pipeline.py — exact 래핑 / 언어별 현지화 / en fallback / 중복 전송 차단 검증

Quality Gate

  • Score: 91/100 (A)
  • Status: PASS (parallel review — MAJOR 1건 포함 지적사항 반영 완료)

Test Plan

  • 단위 테스트 457개 전체 통과 (uv run pytest tests/ --ignore=tests/e2e)
  • prod 재배포 후 실콜: 수신자 응답 시 고정 인사말 1회만 재생되는지 확인
  • ko 외 언어(target ja/zh/vi) 콜에서 네이티브 인사말 확인

🤖 Generated with Claude Code

VoiceToVoice의 첫 인사말이 모델 렌더링([User says in ...] 번역 지시)을
거치면서 통화마다 문구가 달라지고, 수신자 응답 전 소음 환각과 겹쳐
"안내문이 2번 나오는" 현상을 만들었다.

- FIRST_MESSAGE_TEMPLATES를 수신자 언어(ko/ja/zh/vi) 네이티브 문구로
  현지화 (기존엔 전부 영어 — exact 모드였던 TextToVoice에서는 한국인
  수신자에게 영어 인사말이 나가던 잠재 버그도 함께 해소)
- VoiceToVoicePipeline의 FirstMessageHandler에 use_exact_utterance=True
  적용, 기본값도 True로 변경 (레거시 재번역 경로 차단)
- SESSION_A_RELAY_TEMPLATE의 First Message 섹션이 "번역하라"고 지시하던
  모순 제거 — verbatim 발화 지시로 교체
- 테스트 12건 추가 (exact 래핑, 언어별 현지화, fallback, 중복 차단)

Quality Score: 91/100
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wigvo-web Ready Ready Preview, Comment Jul 5, 2026 6:04pm

@HyeonsangKim HyeonsangKim merged commit 0f06e3f into main Jul 5, 2026
5 checks passed
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.

3 participants