fix(briefing): Gemini 추론 수준을 조정해 출력 잘림 방지 - #30
Merged
Merged
Conversation
- Gemini 3 브리핑 요청에 thinkingLevel=low를 명시하고 기존 1500토큰 상한 유지 - MAX_TOKENS 응답을 별도 오류로 구분하고 비밀값 없는 진단 로그 추가 - 요청 설정과 잘린 응답의 비밀값 비노출 회귀 테스트 추가 - 전체 43개 테스트 및 JAR 빌드, 실제 Java 클라이언트의 합성 브리핑 3개 검증
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.
Gemini 키가 정상이어도 실제 리포트의 5개 섹션 브리핑이 502로 실패했습니다. 운영과 같은 프롬프트 형식의 합성 경기에서 기본 추론이 1,500토큰 중 1,438토큰을 소비해 본문을 완성하지 못하고
MAX_TOKENS로 종료되는 문제를 재현했습니다.thinkingLevel=low를 명시해 기존 생성 상한 안에서 브리핑을 작성하도록 조정합니다. 상한을 늘리거나 잘린 응답을 정상 결과로 반환하지 않습니다. 출력 초과는BRIEFING_OUTPUT_LIMIT로 구분하고 HTTP 상태·종료 원인·토큰 수·예외 종류만 기록합니다. 키·프롬프트·생성 내용·외부 오류 본문은 로그에 넣지 않습니다.검증
MAX_TOKENS→low는STOP, 5개 섹션 완성GeminiClient클래스를 운영 컨테이너의 별도 진단 프로세스로 실행: 일반 경기 707자/4.1초, 프로 경기 720자/3.5초, 타격 0개 570자/3.1초. 모두 5개 섹션 완성범위와 운영 적용
현재 운영 모델
gemini-3.6-flash를 유지합니다. 정상 API 응답·DB·인증·소유권·요청 제한·캐시·타임아웃·응답 크기 상한은 동일합니다. 생성 문구는 이전과 바이트 단위로 같음을 보장하지 않습니다.low도 내부 추론을 완전히 없애는 설정은 아니므로 출력이 다시 잘리면 실패로 처리하고 원인을 기록합니다.병합 후 기존 Backend CI/CD로 배포합니다. 롤백은 이 커밋을 되돌려 이전 이미지로 배포하며 서버에 등록한 Gemini 키는 유지합니다.
참고: Google 공식 문서의 추론 토큰·출력 상한 설명
PR CI 통과: 전체 테스트·실행 JAR 빌드. 배포 단계는 건너뛰었으며 미병합입니다.