[Spring AI] Request/Usage Adapter와 Advisor E2E 연결 - #69
Closed
Rigu1 wants to merge 14 commits into
Closed
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
Member
|
#69의 변경은 통합 PR #71에 포함되어 CI 검증을 완료했습니다. 이후 수정과 검토는 #71에서 이어갑니다. |
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.
요약
Spring AI 요청과 provider usage를 Token Pilot의 preflight, reservation, accounting lifecycle에 연결했습니다.
Spring AI 타입은 adapter 모듈 안에 유지하고, 정책·가격·정산은 기존 Core와
ReservationAccounting계약을 사용했습니다. 실제 과금 여부를 확인할 수 없는 호출은 비용이 사라지지 않도록 pending liability로 보존합니다.구현 내용
TEXT_ONLY이며 media, tool과 structured output 요청은 provider 호출 전에 차단합니다.adviseCall()이 preflight부터 reservation, provider 호출과 actual reconciliation까지 하나의 흐름으로 조율합니다.markInFlight()이후 오류는RECONCILIATION_REQUIRED로 남깁니다.ReservationAccounting의 기존 결과를 재사용하여 비용, 상태와 event를 다시 변경하지 않습니다.ThreadLocal을 사용하지 않습니다.ReservedOutputTokensResolver확장 지점을 추가했습니다.설계
LOWEST_PRECEDENCE - 1에 배치했습니다. 사용자가 순서를 직접 지정하면 이 배치가 달라질 수 있습니다.markInFlight()이후 downstream 오류는 보수적으로 pending liability로 보존합니다.검증
./gradlew test./gradlew verifyCompatibilityMatrix verifyCoreConsumergit diff --check범위 외
ReservedOutputTokensResolver구현은 각 provider adapter 또는 사용자 애플리케이션이 담당합니다.체크리스트
필수 E2E 테스트
MODEL_UNRESOLVED로 provider 호출 전에 차단한다.OUTPUT_RESERVATION_UNRESOLVED로 provider 호출 전에 차단한다.markInFlight()이전 오류는 reservation을 한 번 release한다.markInFlight()이후 downstream 오류는 pending liability를 한 번 반영하며 0원 commit/release하지 않는다.Acceptance Criteria
adviseCall()이 reserve부터 reconciliation까지 around lifecycle을 소유한다.ReservationAccountinglifecycle로 연결된다.TEXT_ONLY, framing headroom과 unsupported request scope의 지원 범위와 제한을 기록한다.AGENTS.md에 기록한다.Closes #39