fix(llm): reject nonconforming structured output - #1552
Closed
seonghobae wants to merge 1 commit into
Closed
Conversation
Signed-off-by: Seongho Bae <me@seonghobae.me>
seonghobae
enabled auto-merge (squash)
September 4, 2026 09:16
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe change applies strict Pydantic validation to LLM response models. It rejects extra fields, enforces strict types, and adds contract tests for schema transmission and invalid response handling across three integrations. ChangesStrict LLM contracts
Estimated code review effort: 3 (Moderate) | ~20 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Contributor
Author
auto-merge was automatically disabled
September 4, 2026 09:19
Pull request was closed
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.
목적
Naruon의 구조화 의미 처리 세 경로가 OpenAI 호환
json_schema요청을 보내고, contextual-orchestrator 또는 선택된 테넌트 provider가 스키마 밖 값을 반환하면 성공으로 받아들이지 않도록 닫습니다.감사 결과와 수정
develop의 요약·project graph·근거 기반 검색 경로는 이미AsyncOpenAI.beta.chat.completions.parse(...)와 Pydanticresponse_format을 사용했습니다.json_schemawire envelope로 바꾸지만, Naruon payload 모델은 Pydantic 기본extra=ignore여서 비준수 응답의 미지 필드를 조용히 버릴 수 있었습니다.extra="forbid", strict=True로 바꿔 malformed 응답을 fail closed 처리합니다./chat/completionsbody에response_format.type=json_schema, strict schema, 선택된 model이 들어가는지 확인합니다.organization_id기반 provider 선택, allowlisted/pinned outbound 연결을 그대로 보존합니다. 사용자 응답에는 내부 검증 상세를 노출하지 않습니다.기존 PR 승계
PR #1529의 유효한 wire/fail-closed 요구를 최신 protected base에서 승계합니다. #1529 branch는 현재
develop과 공통 조상이 없어 force push나 unrelated-history merge를 하지 않았습니다. 이 PR이 보호 병합되기 전에는 #1529를 닫지 않습니다.정확한 식별자
develop@6cb9cc93a398e72c1c0daa564da7acbca65376fbf7401c1f44f0fef977438fe51894133f2de81084검증
188 passed, 경고 없음git diff --check: 통과1714 passed, 33 skipped; 기존 protected-main에서도 발생하는 경고 10건이 있어 무경고 통과 증거로 사용하지 않음범위
자유 형식 번역·답장에는 구조화 schema를 억지로 적용하지 않았습니다. 목표 #21의 기계 판독 consumer 결과인 요약/action item, project graph, 근거 기반 검색 응답만 다룹니다.
Summary by CodeRabbit
Bug Fixes
Tests