Skip to content

feat(journey,ai): align Plan/Execute 1차 오픈 quota·SSE·버전 동기화 계약 - #874

Open
SHcommit wants to merge 2 commits into
developfrom
feat/plan-execute-quota-sse-alignment
Open

SHcommit wants to merge 2 commits into
developfrom
feat/plan-execute-quota-sse-alignment

Conversation

@SHcommit

Copy link
Copy Markdown
Member

요약

onmaru-ai-engine (feature/local-e5-embeddings) 기반 Plan/Execute 1차 오픈 계약에 맞춰 Spring BE의 quota 429 / Retry-After 보존, 안전한 baseline fallback 및 명시적 실패 분기, HTTP 200 SSE run.terminal(FAILED) 전달, reviewed_facts=0 / stale heartbeat 가짜 성공 차단, 4개 런타임 버전 변수 동기화 절차를 반영했습니다.

운영 플래그 유지: ONMARU_AI_PLAN_EXECUTE_ENABLED / onmaru.ai.plan-execute-enabled 기본값 및 운영 설정은 검증 완료 및 별도 배포 승인 전까지 false를 유지합니다.

주요 변경

  1. HTTP 429 AI_QUOTA_EXCEEDED + Retry-After 보존 및 무재시도 타임아웃 정합성

    • RetryAfterParser, HttpAiPlanExecuteClient, HttpAiProposalClient
    • HTTP 429 {"code":"AI_QUOTA_EXCEEDED"} + Retry-After(정수 초 및 HTTP-date)를 retryAfterMs와 함께 AiProposalException(AI_QUOTA_EXCEEDED, retryAfterMs)로 보존.
    • 내부 retry sleep으로 run 예산(20s)·AI 타임아웃(15s)을 초과하지 않고 단건 시도로 즉시 실패 전파.
  2. Quota 초과 시 Safe Baseline vs 명시적 실패 + FE 안내 문구 고정

    • JourneyWorkerService, ExplorationResponse, V059__journey_run_degraded_retry_after.sql, JdbcJourneyRunStore, JdbcExplorationStore
    • 안전한 baseline 후보가 있으면 status=COMPLETED, engine=BASELINE, degradedReason=AI_QUOTA_EXCEEDED, retryAfterMs 반환.
    • 안전한 baseline 후보가 없으면 빈 추천을 저장하지 않고 status=FAILED, outcome=null, error.code=AI_QUOTA_EXCEEDED, retryAfterMs로 명시적 실패 처리 및 admission slot 해제.
    • OpenAPI / journey-ai-api-spec.md 및 E2E 테스트에 FE 안내 문구 고정.
  3. SSE HTTP 200 스트림에서 run.terminal(FAILED) + errorCode / retryAfterMs 전달

    • JourneyRunEventBuffer, JourneyRunEventSink, schemas/journey-sse-event(.v1.2).schema.json
    • legacy SSE error 이벤트의 retryAfterMs 파싱 및 public SSE run.terminal 이벤트에 status=FAILED, errorCode, retryAfterMs 포함.
  4. 4개 런타임 버전 변수 동기화 절차 및 reviewed_facts=0 / stale heartbeat 가짜 성공 차단

검증 결과

  • ./gradlew :modules:journey:test: PASS
  • ./gradlew :apps:spring-api:test --tests "com.yrootlab.onmaru.integration.ai.*" --tests "com.yrootlab.onmaru.worker.journey.*" --tests "com.yrootlab.onmaru.web.exploration.*" --tests "com.yrootlab.onmaru.journey.*" --tests "com.yrootlab.onmaru.testing.postgres.JdbcJourneyRunStoreTests" --tests "com.yrootlab.onmaru.testing.postgres.JdbcDurableExplorationWorkerTests" --tests "com.yrootlab.onmaru.testing.postgres.JdbcExplorationStoreIntegrationTests" --tests "com.yrootlab.onmaru.testing.postgres.JourneyMigrationTests" --tests "com.yrootlab.onmaru.testing.postgres.AiPostgresRuntimeIntegrationTests": PASS
  • bash scripts/verify-contracts: PASS (OpenAPI, Journey/R1/R2/identity-saved fixtures, E2E gates, DBML, Azimutt diff)

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant