fix: respect explicit openai chat completion toggle#236
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 4, 2026, 5:05 AM ET / 09:05 UTC. Summary Reproducibility: yes. Current main source shows a custom OpenAI base URL forces chat completions even when the toggle is false, and the patch regression is also source-reproducible through the unchanged daemon OpenRouter call site. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the three-state toggle approach, but make OpenRouter and other required chat-completions routes continue to override false where they are not the user’s OpenAI custom-base toggle, then add focused regression coverage and real gateway proof. Do we have a high-confidence way to reproduce the issue? Yes. Current main source shows a custom OpenAI base URL forces chat completions even when the toggle is false, and the patch regression is also source-reproducible through the unchanged daemon OpenRouter call site. Is this the best way to solve the issue? No, not yet. The three-state toggle is the right direction, but the implementation must preserve OpenRouter’s forced chat-completions behavior before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 821e76613ded. Label changesLabel changes:
Label justifications:
Evidence reviewedAcceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Summary
This fixes the case where
OPENAI_USE_CHAT_COMPLETIONS=false/openai.useChatCompletions=falsewas effectively ignored for customOPENAI_BASE_URLvalues.The root cause was that the current flow collapsed
falseandunsettogether, and custom OpenAI-compatible base URLs were then forced onto chat completions.What changed
true | false | unsetfor the OpenAI chat-completions toggleTests
node node_modules/vitest/vitest.mjs run tests/llm.openai-provider.test.ts tests/run.config.test.ts tests/daemon.chat.test.ts tests/run.context.test.tsnode node_modules/vitest/vitest.mjs run tests/daemon.agent.test.tsCloses #235.