fix(chat-params): drop reasoningEffort injection for openai-compatible providers (fixes #5529)#5557
Open
EvangelosMoschou wants to merge 2 commits into
Conversation
…e providers (fixes code-yeongyu#5529) When an agent config (e.g. Sisyphus/Oracle/Hephaestus) hard-codes reasoningEffort: "medium" for gpt-5.5, that value was injected into the chat request output regardless of the underlying provider package. OpenAI rejects requests that combine tools + reasoning_effort on /v1/chat/completions ("Function tools with reasoning_effort are not supported for gpt-5.5 in /v1/chat/completions. Please use /v1/responses instead."). openai-compatible providers (vLLM, llama.cpp, SaladCloud, etc.) and any non-native-openai variant may route through that endpoint, so the unconditional injection broke those setups silently with a 400 error. Read model.api.npm from the chat-params hook input and drop the reasoningEffort injection when the npm is set to anything other than "@ai-sdk/openai". When api.npm is missing (backward compat), preserve the existing behavior. Tests (TDD): - RED: openai-compatible provider + gpt-5.5 stored reasoningEffort -> output.options retained reasoningEffort (bug). - GREEN: same input now strips reasoningEffort. - Native openai provider + gpt-5.5 -> reasoningEffort preserved. - api.npm missing -> reasoningEffort preserved (backward compat). - All 5 existing tests still pass.
… whitelist PR code-yeongyu#5556 added two new project-original brand design reference files (references/design/aside.md and references/design/motherduck.md) and updated the .gitignore to allow them to commit, but the provenance-gate.test.ts whitelist (designOriginals in frontend-refs-manifest.mjs) was not updated to match. As a result, the 'no third-party-derived reference file is committed' test fails on every PR that runs after PR code-yeongyu#5556 landed. Add the two new files to the designOriginals whitelist so the provenance gate recognises them as project-originals. The .gitignore, the .gitmodules, and the test were all already updated to match — only the manifest whitelist lagged. Unblocks the CI run for any PR that touches packages/ after 4efeb5d.
3e554e9 to
fec23ec
Compare
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.
Problem
When an agent config (e.g. Sisyphus, Oracle, Hephaestus) hard-codes
reasoningEffort: "medium"for gpt-5.5, that value was injected into the chat-params output regardless of the underlying provider package. OpenAI rejects requests that combinetools+reasoning_efforton/v1/chat/completions:openai-compatibleproviders (vLLM, llama.cpp, SaladCloud, etc.) and any non-native-openai variant may route through that endpoint, so the unconditional injection broke those setups silently with a 400 error.Root Cause
packages/omo-opencode/src/plugin/chat-params.tsinjectsoutput.options.reasoningEffortfrom the resolved compatibility value without checking which provider package the request is going to. The OpenCode core fix (anomalyco/opencode#31465) scopedreasoningEffortto native providers only, but omo re-injects the value at the chat-params layer, bypassing that fix.Fix
Read
model.api.npmfrom the chat-params hook input and drop thereasoningEffortinjection when the npm is set to anything other than"@ai-sdk/openai". Whenapi.npmis missing (backward compat — older plugins or hook consumers that don't forward the api field), preserve the existing behavior.The change is localized to the chokepoint that actually writes the value to the request output, so all five sites that hardcode
reasoningEffort: "medium"in the agent configs (Sisyphus, Hephaestus, Oracle, Momus, Sisyphus-Junior) are covered without touching them.TDD Evidence
openai-compatibleprovider +gpt-5.5+ storedreasoningEffort: "medium"→ test assertedoutput.optionsmust NOT containreasoningEffort, but the actual output retained"reasoningEffort": "medium"(bug reproduced).reasoningEffortcleanly.api.npm === "@ai-sdk/openai") +gpt-5.5→reasoningEffortpreserved.reasoningEffortpreserved (backward compat for any consumer that doesn't forward the api field).packages/omo-opencodesuite: 8048 pass, 4 pre-existing failures (unrelated to this change —fixEmptyMessagesWithSDKfailures exist on upstream/dev as well).bun run typecheck:packages: clean.Files
packages/omo-opencode/src/plugin/chat-params.ts(+16/-1) — readapi.npm; gatereasoningEffortinjection on native-openai npmpackages/omo-opencode/src/plugin/chat-params.test.ts(+103/-1) — 3 new test casesFixes #5529
Summary by cubic
Stop injecting reasoningEffort into chat params for OpenAI‑compatible providers to prevent 400 errors when using tools with gpt-5.5. Fixes #5529.
reasoningEffortto native@ai-sdk/openai; strip it for@ai-sdk/openai-compatibleand other non-native providers to avoid/v1/chat/completionstools +reasoning_efforterrors. Preserve behavior whenmodel.api.npmis missing; added tests.aside.mdandmotherduck.mdindesignOriginalswithinpackages/shared-skillsprovenance checks.Written for commit fec23ec. Summary will update on new commits.