Skip to content

[AI Integration] AiRuntimeClient·계약 검증·장애 격리 구현 #8

Description

@hywznn

목표

Server가 Prompt·Provider를 직접 소유하지 않고, 검증한 요청을 AI Runtime에 전달한 뒤 응답을 다시 검증합니다.

AiRun (#24)
→ AiRuntimeClient (#8)
→ POST /internal/v1/analyses (fowoco/ai)

현재 요청 계약

PLAN은 사용자가 작성한 원문만 전달합니다. Client의 빠른 선택 태그나 Intent 코드를 발화문에 덧붙이지 않습니다.

{
  "requestId": "10000000-0000-0000-0000-000000000001",
  "phase": "PLAN",
  "analysisInput": {
    "instruction": "응웬반안 체류연장 준비해줘"
  }
}
  • requestId: PLAN과 ANALYZE를 같은 실행으로 연결
  • phase: PLAN 또는 ANALYZE
  • analysisInput: 실제 분석 데이터
  • Intent는 Runtime 응답의 detectedIntent를 사용
  • Workflow는 WF-STY-001 같은 canonical workflowId를 사용
  • ANALYZE에서는 같은 requestId와 #74가 해결한 Slot 정보만 추가

Server 책임

  • Bearer service 인증과 request/trace 전달
  • HTTP/1.1, timeout, bulkhead, circuit breaker, 응답 크기 제한
  • strict JSON parsing과 requestId·핵심값 검증
  • Runtime 호출 1회당 Server 내부 AiAttempt 1개
  • Agent·OCR의 Server DB 직접 접근 금지
  • API Key, JWT, 비밀번호, Worker Link 원본 token 차단

구현 현황

완료 기준

실제 Runtime을 호출해 다음을 확인하면 이 이슈를 완료합니다.

  1. PLAN 요청이 원문 그대로 전달됨
  2. detectedIntent=EXPIRY_RENEWAL, workflowId=WF-STY-001 형태로 수신
  3. 필요한 Slot이 있으면 ANALYZE 재호출까지 성공
  4. timeout·계약 오류가 Server 공통 오류로 안전하게 변환됨

관계

Metadata

Metadata

Assignees

Labels

area:ai-integrationServer ↔ AI Runtime 내부 계약·Client·검증·trace 연동 영역; Prompt·모델·Provider 구현은 ai 저장소 소유area:serverSpring Boot API·도메인·DB·tenant·Task Workflow 영역; Prompt·모델·Provider 구현 제외priority:P0MVP 진행을 막는 최우선 핵심 작업security:privacy개인정보·접근권한·토큰·보안 영향이 있는 작업status:in-progress담당자가 현재 구현 중인 작업type:integration외부 LLM·DB·스토리지 등 시스템 간 연동 작업

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions