feat: AI Runtime HTTP 연결과 장애 격리 구현 - #56
Draft
hywznn wants to merge 5 commits into
Draft
Conversation
표준 Bearer 인증과 요청 추적 헤더를 사용해 versioned internal API를 정확히 한 번 호출합니다. 기본 비활성화 설정, 전체 deadline, 동시 호출 제한, circuit breaker, 응답 크기 및 JSON 검증을 추가합니다.
WireMock standalone으로 인증·추적 헤더, camelCase 요청, strict JSON 응답을 검증합니다. 자동 재시도 금지, deadline, 응답 크기, bulkhead와 circuit breaker 동작을 함께 확인합니다.
초보자도 설정과 장애 코드를 이해할 수 있도록 기본 비활성화 이유, 배포 순서, 오류별 대응을 문서화합니다. ADR에 맞춰 표준 Authorization Bearer 인증과 요청 추적 규칙을 명시합니다.
AI 후보가 요청에 포함된 stay_expiry_date를 다른 값으로 바꾸면 CORE_VALUE_MISMATCH로 거부합니다.
17 tasks
krestar
approved these changes
Jul 28, 2026
krestar
left a comment
Contributor
There was a problem hiding this comment.
408 타임아웃이 INVALID_REQUEST_CONTRACT로 처리되는걸로 보이는데, 문제 없을 것 같으면 나머지 리뷰 포인트 2~4번은 적절해보여서 PR 내용 괜찮아 보입니다
| ); | ||
| } | ||
|
|
||
| private AiRuntimeCallException classifyStatus(int status) { |
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.
연결 이슈
Refs #8
왜 필요한가요?
기존 구현은 Server가 AI Runtime에 보낼 수 있는 비식별 계약과 응답 검증까지만 제공했습니다.
실제 배포 환경에서
fowoco/ai를 안전하게 호출하려면 서비스 간 인증, 제한시간, 장애 격리,응답 크기 제한과 안정적인 실패 분류가 추가로 필요합니다.
현재
fowoco/ai에는/internal/v1/analyses원본 계약이 아직 release되지 않았으므로,통합 기능은 기본 비활성화하고 설정을 명시적으로 켠 환경에서만 호출하도록 했습니다.
무엇이 바뀌나요?
AiRuntimeClient뒤에RemoteAiRuntimeClient를 추가했습니다.Authorization: Bearer <service-credential>,X-Request-Id, 선택적 W3Ctraceparent를 전달합니다.deadlineMs와 Server 상한 중 더 짧은 전체 deadline을 적용합니다.알 수 없는 필드를 거부합니다.
AiRuntimeFailureCode로 분류합니다.수행해야 합니다.
DisabledAiRuntimeClient가RUNTIME_DISABLED로 안전하게 실패합니다.설정
AI_RUNTIME_ENABLED=falseAI_RUNTIME_ENDPOINT,AI_RUNTIME_SERVICE_CREDENTIAL을 배포 Secret으로 주입.env.example에 문서화검증
./gradlew test --tests 'com.fowoco.server.aiintegration.*'./gradlew testoversized response, bulkhead, circuit breaker를 검증했습니다.
이번 PR에 포함하지 않은 것
fowoco/ai의/internal/v1/analysesOpenAPI·JSON Schema 원본 release리뷰 포인트
AiRuntimeFailureCode분류가 #24에서 저장할 진단값으로 충분한지fowoco/ai원본 계약으로 확정해도 되는지