feat(api): validate reasoning_effort enum and modalities list - #167
feat(api): validate reasoning_effort enum and modalities list#167seonghobae wants to merge 1 commit into
Conversation
Reject unknown reasoning_effort values and non text/audio modalities so OpenAI clients get clear gateway 400s before orchestration or passthrough.
|
Warning Review limit reached
Next review available in: 13 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
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 |
Fail-closed edge checks for reasoning.effort/summary/mode/context on POST /v1/responses. Complements chat reasoning_effort enum validation without depending on stacked merge of #167.
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current headf42757063dcdb6621fc3610d2499fd54b13ba36c. -
Head SHA:
f42757063dcdb6621fc3610d2499fd54b13ba36c -
Workflow run: 31702688715
-
Workflow attempt: 1
Coverage evidence
Coverage evidence job did not run or did not publish coverage evidence.
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (3 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (3 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Docs: rest_api_design.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: rest_api_design.md"]
R2 --> V2["docs review"]
Evidence --> S3["Test: test_reasoning_modalities_validation.py"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test: test_reasoning_modalities_validation.py"]
R3 --> V3["targeted test run"]
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Review outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage evidence job did not run or did not publish coverage evidence. Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (3 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (3 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Docs: rest_api_design.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: rest_api_design.md"]
R2 --> V2["docs review"]
Evidence --> S3["Test: test_reasoning_modalities_validation.py"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test: test_reasoning_modalities_validation.py"]
R3 --> V3["targeted test run"]
|
Summary
reasoning_effortwhen present: one ofminimal|low|medium|high.modalitieswhen present: non-empty array oftext|audio.Why
OpenAI o-series SDKs send
reasoning_effort; multimodal clients sendmodalities. On main these pass without shape checks. Buyer-felt fail-closed 400s land while the larger routing stack waits on sole-collaborator approval.Test plan
python tests/test_reasoning_modalities_validation.pypytest tests/test_reasoning_modalities_validation.py -q