Repository navigation
fix(openai-codex): send the verbosity setting in requests - #1977
Conversation
The Codex provider accepted a verbosity setting but never sent it, so choosing low or high had no effect. buildRequestBody() now adds text.verbosity for models with supportsVerbosity, falling back to "medium" like OpenAI Native, and omits it for other models. Closes Zoo-Code-Org#1958
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (5)Treat model, provider, MCP, path, command, and tool data as untrusted.⚙️ CodeRabbit configuration file Files:
Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases.⚙️ CodeRabbit configuration file Files:
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths.⚙️ CodeRabbit configuration file Files:
Verify extension/webview contracts, cancellation and error propagation, VS Code lifecycle correctness, and behavior under retries and partial failure.⚙️ CodeRabbit configuration file Files:
Act as an adversarial second-opinion reviewer.⚙️ CodeRabbit configuration file Files:
🔇 Additional comments (2)
📝 SummarySummary by CodeRabbit
WalkthroughThe Codex request builder now includes ChangesCodex verbosity requests
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The verbosity setting reaches requests on the covered paths. No actionable merge-blocking risk remains after normal checks. 🚥 Pre-merge checks | ✅ 8✅ Passed checks (8 passed)✨ Finishing Touches🧪 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 |
Review statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Awaiting fresh human maintainer or CODEOWNER approval. Automated review is complete for the latest commit but does not replace human approval. Review-state labels are managed by this workflow; do not edit them manually. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
WebMad
left a comment
There was a problem hiding this comment.
Thank you for your contribution! See you in the next PRs
|
Thanks for the contribution @tosinxt ! |
Related GitHub Issue
Closes: #1958
Description
OpenAiCodexHandler.buildRequestBody()now addstext: { verbosity }for models whose catalog entry hassupportsVerbosity: true, falling back to"medium"when the setting is unset, the same ruleopenai-native.tsuses. Models without the flag get notextfield, so their requests are unchanged.createMessage()andcompletePrompt()both build their request throughbuildRequestBody().transformResponsesLiteBody()already carries unrelated fields through, and the GPT-6.1 Sol tests confirmtext.verbosityreaches the Lite request.ResponsesRequestBodygainstext?: { verbosity: VerbosityLevel }.model.verbosityis already typedVerbosityLevel | undefined, so no cast is needed (Native casts because its value arrives asany).AGENTS.md, maintainers manage those).Acceptance criteria → tests in
openai-codex.spec.ts(OpenAiCodexHandler verbosity), all inspecting the body passed to the mockedresponses.create:low/medium/highsent astext.verbosity, for chat and one-shot, on ordinary Responses (gpt-5) and Responses Lite (gpt-6.1-sol)$apiModelId $call request sends text.verbosity $expected when verbosity is $verbosity(12 cases)"medium", same matrixverbosity is unsetcases (4)gpt-5-codex, verbosityhigh) → notextomits text.verbosity for a model without verbosity support(chat, one-shot)Test Procedure
Run from
src/:pnpm exec vitest run api/providers/__tests__/openai-codex.spec.ts api/providers/__tests__/openai-native.spec.ts: before the fix, the 16 "sends text.verbosity" cases fail (expected undefined to deeply equal { verbosity: 'low' }, etc.); after it, 145/145 pass (66 Codex, 79 Native).pnpm exec vitest run api: 122 files, 3,019 passed, 2 skipped.core/webview/__tests__/ClineProvider.spec.ts,core/webview/__tests__/webviewMessageHandler.spec.ts,shared/__tests__/checkExistApiConfig.spec.ts): 306 pass.pnpm check-types✅,pnpm lint✅ (--max-warnings=0), Prettier ✅.Not run: live requests to the Codex backend (needs a ChatGPT sign-in). As the issue suggests, everything is verified with mocked SDK calls.
Pre-Submission Checklist
Visual Snapshots
N/A, no UI change.
Videos (interaction / animation only)
N/A.
Documentation Updates
Additional Notes
None.
Get in Touch
Discord: tosin.py