fix(voice): ETC 분류 후에도 save_farming_record를 호출하도록 지침 보강 - #66
Merged
Conversation
음성 기록에서 "기타(ETC)로 처리되면 작성 화면에 농장·작물·메모가 비고, 그 외 유형은 정상"인 버그 수정. 원인: 파서·매퍼·compose는 workType 무관하게 farm/crop/workType/memo를 처리하고(타입별 분기는 detail 객체뿐) 다른 유형은 정상 동작하므로, ETC만 비는 것은 모델이 ETC일 때 save_farming_record를 제대로 호출하지 않아 candidate가 비었기 때문. 지침은 일반 유형엔 "필수정보 수집→확인→저장" 구동이 있으나, ETC는 EXCEPTION_HANDLING에서 "기타로 분류·안내"까지만 있고 저장으로 이어지는 문구가 없어 모델이 분류만 하고 tool 호출 없이 멈출 수 있었음. 수정: ETC로 분류해도 농지·작물을 확인하고 memo를 작성해 다른 유형과 동일하게 save_farming_record를 반드시 호출하도록 EXCEPTION_HANDLING에 명시. 회귀 테스트 추가. `./gradlew :application:test --tests "*Voice*"` 통과. 주의: 모델 행동은 지침으로 유도하는 것이라 최종 확인은 실제 음성 세션 1회가 필요(진단 로그 PR #64/#65로 candidate null→채움 확인 가능). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
프론트 진단 로그로 근본 원인 확정: ETC 대화에서 function_call 이벤트가 전무하고 (response.function_call_arguments.done 0건, output_item은 전부 message/audio), 모델이 6+ 응답 사이클 동안 save_farming_record를 끝내 호출하지 않아 사용자가 수동 종료(toolArgsLen=-1)함. 파서/매퍼는 파싱할 이벤트 자체가 없었으니 결백. 모델 저항이 강해, EXCEPTION_HANDLING 보강(직전 커밋)만으로 부족할 수 있어 tool 바로 옆과 요구사항 섹션에도 신호를 추가: - 스키마 tool description: 필수 4개(farmId·cropId·workType·memo)와 유형별 상세를 구분하고, WATERING·WEEDING·PRUNING·ETC는 상세 없이 필수 4개만 갖춰지면 곧바로 호출하도록 명시. - WORK_TYPE_REQUIREMENTS: 상세 없는 유형은 상세를 기다리지 말고 곧바로 저장하도록 명시(특히 ETC는 대화를 끌지 말 것). 회귀 테스트 2건 추가. `./gradlew :application:test *VoiceSessionInstructions* *FarmingRecordVoiceToolSchema*` 통과. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Kimseungin0529
marked this pull request as ready for review
July 22, 2026 02:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 내용
음성 세션 지침(
VoiceSessionInstructions)의EXCEPTION_HANDLING에서, 작업 유형을 ETC(기타)로 분류한 뒤에도 농지·작물을 확인하고 memo를 작성해 다른 유형과 동일하게save_farming_record를 반드시 호출하도록 명시. 회귀 테스트 추가.변경 이유
"음성 기록이 기타(ETC)로 처리되면 작성 화면에 농장·작물·메모가 전부 비고, 기타 이외 유형은 정상적으로 채워진다"는 사용자 실측 버그.
근본 원인 (프론트+백엔드 코드 직접 정독 + 실측 교차검증):
RealtimeEventParser)·매퍼(VoiceCandidateMapper)·작성 화면(RecordComposeViewModel/View)은 모두 workType과 무관하게 farmId/cropId/workType/memo를 처리한다. 타입별 분기는 상세(detail) 객체에만 있다. 다른 유형이 정상 동작하므로 이 파이프라인 자체는 정상.save_farming_record를 제대로(또는 아예) 호출하지 않아 candidate가 비었기 때문이며, 이는 백엔드가 세션에 등록하는 지침(prompt)이 지배한다 → 프론트 파싱 문제 아님, 백엔드(지침) 문제.WORK_TYPE_REQUIREMENTS로 "필수정보 수집 → 완료확인 → 저장" 구동이 있으나, ETC는EXCEPTION_HANDLING에 "기타로 분류·안내"까지만 있고 저장으로 이어지는 문구가 없어, 모델이 "기타로 기록할게요"라고 말한 뒤 tool 호출 없이 멈출 수 있었다.관련 참고: 앱은
gpt-realtime(GA) 사용. 이전 프론트 수정 PR #60은 main 배포됐으나 이 ETC 증상엔 무효(파서의 missing-name 가설은 GA SDK로 반증됨).영향 범위
application음성 세션 지침 텍스트 + 회귀 테스트. API/DB/설정 변화 없음. 모델 대화 품질(ETC 저장 유도)에만 영향.검증
./gradlew :application:test --tests "*VoiceSessionInstructions*"— BUILD SUCCESSFUL (신규 회귀 테스트 포함)./gradlew :application:test --tests "*Voice*"— BUILD SUCCESSFUL배포 및 호환성
해당 없음 (지침 텍스트만). 세션 발급 시 새 지침이 자동 반영됨.
체크리스트