Skip to content

Gemini prediction 400 응답 원인을 진단하고 수정한다 #24

Description

@opficdev

배경

실제 consumer repository에서 workflow_dispatch로 Watcher를 실행했을 때 deterministic merge risk report는 생성되었지만 AI prediction 단계가 실패했다.

report에는 다음 형태로 표시되었다.

- ai prediction:
  - status: `failed`
  - error: Gemini prediction request failed with status 400

API key가 누락되거나 인증이 실패한 경우라기보다는 Gemini API가 요청을 받았지만 request body, model, structured output schema 중 하나를 잘못된 요청으로 판단한 상황으로 보인다.

목표

Gemini prediction 호출이 실제 GitHub Actions 실행 환경에서 성공하도록 request body와 오류 진단 정보를 정리한다.

작업 범위

  • Gemini generateContent request body를 공식 REST API 문서 기준으로 재검증
  • system_instructionsystemInstruction 등 request field naming 확인
  • structured output 설정인 responseFormat, mimeType, schema 사용 방식 확인
  • 기본 Gemini model이 실제 사용 가능한 model인지 확인
  • Gemini HTTP 실패 시 response body 일부를 error message 또는 log에 포함
  • Gemini 400 응답을 재현할 수 있는 최소 테스트 또는 fixture 추가
  • 실제 workflow_dispatch report에서 AI prediction이 predicted로 표시되는지 확인

완료 기준

  • Gemini API가 400을 반환할 때 원문 오류를 확인할 수 있음
  • 잘못된 request body 또는 model 설정이 수정됨
  • npm test 통과
  • 실제 workflow 실행에서 AI prediction이 failed가 아닌 predicted 또는 검증 가능한 정상 상태로 표시됨

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions