Skip to content

feat(call): 로그인한 팬의 지난 통화를 연습생이 기억하기 - #41

Draft
Lee-Soyeon wants to merge 1 commit into
feat/pass-naturalnessfrom
feat/call-memory
Draft

Lee-Soyeon wants to merge 1 commit into
feat/pass-naturalnessfrom
feat/call-memory

Conversation

@Lee-Soyeon

Copy link
Copy Markdown
Contributor

로그인한 팬이 걸었던 연습생과 다시 통화하면 연습생이 지난 통화를 기억하고 먼저 꺼냅니다.

목적

지금은 통화가 끝나면 대화가 사라져서 팬이 다시 걸어도 연습생이 처음 보는 사람처럼 대합니다. 경쟁 앱 리뷰에서 "한 번 대화하고 나면 다시 모르는 사람이 된다"가 반복해서 나온 불만이라(판정표 §1.1 기억 항목), 팬이 쌓은 관계가 이어지게 만듭니다. 이 PR은 앞서 만든 memory(통화에 지난 대화를 넣는 입구)에 저장하는 쪽을 채웁니다.

주요 변경 사항

통화 중 대화를 앱으로 내보내기 (feat/pass-naturalness에서 이미 푸시됨)

  • 연습생이 말하거나 팬이 말할 때마다 한 줄씩 fancall.transcript로 전달
  • 통화 시작 인사·조용할 때 먼저 거는 말 같은 내부 문구는 제외

저장과 불러오기 (이 PR)

  • 새 테이블 call_memories: 로그인한 사용자 id × 연습생 key별로 줄 저장, 최근 200줄만 유지
  • 통화 시작(dispatch)에 memoryKey를 보내면 로그인한 팬의 저장된 줄을 자동으로 memory에 넣음. 앱이 memory를 직접 보내면 그쪽을 우선
  • POST /live-rooms/memory로 줄 추가(한 번에 50줄까지), DELETE /live-rooms/memory/{memoryKey}로 그 연습생과의 기억 삭제
  • 비로그인 팬은 저장도 불러오기도 하지 않음(401 / 빈 기억)
  • 프론트: LiveRoomRepository.appendMemory, forgetMemory, AgentDispatchRequest.memoryKey

호스트 앱이 해야 할 일

  1. 새 마이그레이션(a7c3d2e91f40_call_memories_table) 실행
  2. 통화 걸 때 memoryKey(연습생 id) 전달
  3. AgentCall의 onTranscriptLine에서 줄을 모아 appendMemory 호출(통화 끝나기 전·끝날 때)
  4. 팬이 기억을 지울 수 있는 화면에서 forgetMemory 호출

개인정보 관련 결정이 필요한 것

  • 대화 내용이 DB에 남습니다. 보관 기간·삭제 요청 대응·개인정보 처리방침 문구는 영욱과 정해야 합니다.
  • 저장된 줄은 다음 통화에서 AI 프롬프트에 "기록"으로만 들어가고 지시로는 따르지 않게 되어 있습니다(시험: 기록 속 지시 무시 6/6).

테스트 체크리스트

  • 로그인한 팬이 통화 후 같은 연습생에게 다시 걸면 지난 일을 꺼낸다
  • 다른 팬·다른 연습생의 기억이 섞이지 않는다
  • 기억 삭제 뒤 다시 걸면 처음 보는 사람처럼 대한다
  • 로그인 안 한 팬은 기억이 저장되지도 불러와지지도 않는다
  • 200줄을 넘기면 오래된 줄부터 사라진다

자동 시험: 단위 테스트 130개(저장소 7 · 라우트 9 추가), pylint 10/10, mypy·pyright 0, 프론트 type-check·jest 통과. Postgres 마이그레이션 실행은 아직 해 보지 못했습니다(테스트는 SQLite).

🤖 Generated with Claude Code

https://claude.ai/code/session_01AtsuqBSuAK5BAFAqzBocNz

Adds a call_memories table, an add and forget route under /live-rooms/memory,
and memoryKey on dispatch: when the fan is signed in and the host passes no
memory, the stored lines of earlier calls with that trainee are loaded. Lines
are scoped by the signed-in user id, capped at 200 per trainee, and the fan can
forget them. The host app must run the new migration.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AtsuqBSuAK5BAFAqzBocNz

ywkim commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

📦 fancall 개발은 buppy 모노레포로 옮겼습니다

fancall은 이제 algorima/buppy 안의 모듈(backend/fancall/, frontend/src/fancall/)입니다. 이 레포의 PR은 여기서 머지하지 않고, buppy에 새 PR로 옮겨 리뷰합니다.

  • v0.5.0까지: algorima/buppy#1499 에서 커밋 이력째 합쳤습니다.
  • v0.5.1~v0.13.0: algorima/buppy#1502 ~ algorima/buppy#1506 스택에서 리뷰 중입니다. 열린 PR들은 이 코드 위에서 만든 것이라, 스택이 머지된 뒤 옮기면 충돌이 가장 적습니다.

이 PR

#37 위에 쌓여 있습니다. backend/alembic/versions/의 마이그레이션은 옮겨지지 않습니다. buppy backend/에서 alembic revision --autogenerate로 다시 만듭니다(buppy CLAUDE.md 규칙).

경로 대응

fancall buppy
backend/fancall/ backend/fancall/ (같음)
backend/tests/unit/test_*.py backend/tests/unit/test_fancall/test_*.py
frontend/src/ 아래 components/, repositories/, i18n/locales/, i18n/translations.ts, client.ts, index.ts, schemas.ts frontend/src/fancall/ 아래 같은 경로
데모 앱 frontend/src/app/, backend/main.py, backend/alembic/, pyproject.toml·poetry.lock, docs/, backend/tools/ 자동으로 옮겨지지 않습니다. buppy의 해당 위치에 직접 반영합니다

옮기는 방법

algorima/buppy#1499와 같은 경로 매핑으로 이 PR의 커밋을 다시 쓴 뒤 buppy에 cherry-pick합니다. 작성자와 커밋 메시지가 그대로 남고, 메시지의 (#N)은 (aioiahq/fancall#N)으로 바뀝니다. git-filter-repo가 필요합니다.

git clone https://github.com/algorima/fancall.git fancall-buppy && cd fancall-buppy
BASE=feat/pass-naturalness; PR_BRANCH=feat/call-memory
for b in "$BASE" "$PR_BRANCH"; do git show-ref -q --verify "refs/heads/$b" || git branch "$b" "origin/$b"; done
git filter-repo --force --refs "$BASE" "$PR_BRANCH" \
  --path backend/fancall/ --path backend/tests/unit/ \
  --path frontend/src/client.ts --path frontend/src/index.ts --path frontend/src/schemas.ts \
  --path frontend/src/components/ --path frontend/src/i18n/translations.ts \
  --path frontend/src/i18n/locales/ --path frontend/src/repositories/ \
  --path-rename backend/tests/unit/:backend/tests/unit/test_fancall/ \
  --path-rename frontend/src/:frontend/src/fancall/ \
  --message-callback 'import re
return re.sub(rb"\(#(\d+)\)", rb"(aioiahq/fancall#\1)", message)'
cd ../buppy && git fetch origin main && git switch -c <새 브랜치> origin/main
git fetch ../fancall-buppy "$BASE:fancall/$BASE" "$PR_BRANCH:fancall/$PR_BRANCH"
git cherry-pick "fancall/$BASE..fancall/$PR_BRANCH"

buppy에서 달라진 점

  • 컴패니언 통화의 음성·아바타 ID는 컴패니언 Live 설정의 voiceId(ElevenLabs)·faceId(Simli)에서 옵니다(algorima/buppy#1503).
  • 백엔드는 buppy 기준(black 23, pyright 1.1.358)으로 검사합니다: make -C backend format lint type-check unit-test, make -C backend tach.
  • 프런트 번역 키는 t("fancall:key")로 씁니다(ADR-0002). fancall 모듈은 앱 코드와 aidol을 import할 수 없습니다(tach, eslint boundaries).
  • 영상 파일은 커밋할 수 없습니다(Danger가 CI를 실패시킴). gs://buppy/static/에 올리고 URL로 참조합니다.
  • PR을 여러 개 쌓을 때는 buppy docs/stacked-pr-guide.md(gh stack)를 따릅니다.

옮긴 뒤에는 이 PR에 buppy PR 링크를 남기고 닫아 주세요.


Generated by Claude Code · session session_01T5SeyErbjJvce4P8rjmZzs


Generated by Claude Code

ywkim commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

buppy 이식 순서 (기록용)

buppy의 fancall 스택은 #1508 → #1503(#15·#18) → #1504(#26·#32·#27) → #1505(#31·#33) → #1506(#19·#20)입니다. 모두 fancall에서 이미 머지된 PR만 옮겼고, 지금 열린 PR과 겹치는 커밋은 없습니다.

  1. #39를 buppy #1504에 합치기 (프론트 schemas.ts 4줄)
  2. #38은 buppy에 이미 반영되어 있어 옮기지 않음
  3. feat(call): 휴대폰 영상통화 화면과 벨 울리는 동안 방 준비 #22 → feat(call): 연락처에서 아이돌을 골라 영상통화 걸기 #23 → #24를 buppy #1506 위에 새 스택으로
  4. #17에만 남은 부분을 정리한 뒤 feat(agent): 팬이 조용하면 연습생이 먼저 말하기 #34 → fix(agent): 팬이 끊으면 방을 지워 아바타까지 바로 종료 #35 → feat(call): 말로 대화하기와 자연스러움 합격선 #36 → feat(call): 실측 맞장구·바로 대답·상반신 화면으로 자연스러움 합격선 맞추기 #37
  5. feat(avatar): 연습생 얼굴을 직접 그리는 아바타 (GPU 렌더 서버) #40~#43은 draft가 풀린 뒤

#17 의존 문제

#34~#43은 모두 #17 브랜치(feat/realtime-avatar) 위에 쌓여 있어 diff가 #17 내용을 전제로 합니다. #17의 일부는 이미 나뉘어 옮겨졌지만(#18 → buppy #1503, #19·#20 → buppy #1506, C·D·E → #22~#24), #17에만 남은 부분이 있습니다: typecast_tts.py, settings.py의 AvatarSettings 등 54줄, worker.py 약 200줄, experiments/lam. 이 부분을 버릴지 따로 옮길지 정해야 이 줄을 옮길 수 있습니다.

이 PR은 5번 단계이고 #37 위에 있습니다. alembic/versions/a7c3d2e91f40_*.py는 buppy 규칙상 alembic revision --autogenerate로 다시 만들어야 합니다. LiveRoomRepository.ts는 buppy frontend/src/fancall/repositories/와 맞춰야 합니다.


Generated by Claude Code · session session_01T5SeyErbjJvce4P8rjmZzs


Generated by Claude Code

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