[codex] preserve image detail in responses#32
Conversation
|
@codex review |
|
✅ Actions performedFull review triggered. |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds support for an optional 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/openai-compat.test.ts (1)
800-844: ⚡ Quick winAdd one more case to cover the second normalization branch.
Line 800 validates message-content
input_image.detail, but not top-level content-item normalization (normalizeResponseContentItem) or nestedimage_url.detail. Adding those keeps this regression fully locked down.Suggested test shape
-Deno.test("openai: responses preserve image detail on normalized input images", async () => { +Deno.test("openai: responses preserve image detail on normalized input images", async (t) => { // existing case... + + await t.step("preserves detail on top-level input_image items", async () => { + // input: [{ type: "input_image", image_url: "...", detail: "high" }] + // assert forwarded input_image keeps detail + }); + + await t.step("preserves nested image_url.detail", async () => { + // input: [{ role: "user", content: [{ type: "image_url", image_url: { url: "...", detail: "high" } }] }] + // assert forwarded input_image keeps detail + }); });
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1a2511a9-dcf1-4226-964b-cab109eb910c
📒 Files selected for processing (3)
src/openai.tssrc/types.tstests/openai-compat.test.ts
Summary
detailon normalizedinput_imagecontent before forwarding/v1/responsesrequests to Codex.image_url.detailas well as top-level Responsesinput_image.detail.detail: "high".Root Cause
The gateway accepted OpenAI-compatible image input shapes, but normalization rebuilt image content as
{ type: "input_image", image_url }and droppeddetail. Runtime callers could senddetail: "high", but Codex never received it. Dense menu-photo OCR throughgpt-5.5then behaved like an omitted-detail request and returned upstream 502s for real menu photos.Impact
Clients using
ai.ubq.fi/v1/responsescan now explicitly control image detail for vision/OCR requests. This is needed by restaurant-food-picker before relying on GPT-5.5 for menu-image extraction.Validation
deno fmt --check src/openai.ts src/types.ts tests/openai-compat.test.tsdeno task lintdeno task builddeno test --allow-env --allow-net tests/openai-compat.test.tsdeno test --env --allow-env(118 passed)Note
deno task testcurrently fails because the task runsdeno test --envwithout env permission whiletests/embeddings.test.tsreadsVOYAGEAI_API_KEYat module load. Rerunning with explicit--allow-envpasses.