Skip to content

fix(chat-params): drop reasoningEffort injection for openai-compatible providers (fixes #5529)#5557

Open
EvangelosMoschou wants to merge 2 commits into
code-yeongyu:devfrom
EvangelosMoschou:fix/5529-reasoning-effort-openai-compatible
Open

fix(chat-params): drop reasoningEffort injection for openai-compatible providers (fixes #5529)#5557
EvangelosMoschou wants to merge 2 commits into
code-yeongyu:devfrom
EvangelosMoschou:fix/5529-reasoning-effort-openai-compatible

Conversation

@EvangelosMoschou

@EvangelosMoschou EvangelosMoschou commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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 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.

Root Cause

packages/omo-opencode/src/plugin/chat-params.ts injects output.options.reasoningEffort from the resolved compatibility value without checking which provider package the request is going to. The OpenCode core fix (anomalyco/opencode#31465) scoped reasoningEffort to native providers only, but omo re-injects the value at the chat-params layer, bypassing that fix.

Fix

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 — 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

  • RED: openai-compatible provider + gpt-5.5 + stored reasoningEffort: "medium" → test asserted output.options must NOT contain reasoningEffort, but the actual output retained "reasoningEffort": "medium" (bug reproduced).
  • GREEN: same input now strips reasoningEffort cleanly.
  • Native openai (api.npm === "@ai-sdk/openai") + gpt-5.5reasoningEffort preserved.
  • api.npm missingreasoningEffort preserved (backward compat for any consumer that doesn't forward the api field).
  • All 5 existing tests still pass.
  • Full packages/omo-opencode suite: 8048 pass, 4 pre-existing failures (unrelated to this change — fixEmptyMessagesWithSDK failures exist on upstream/dev as well).
  • bun run typecheck:packages: clean.

Files

  • packages/omo-opencode/src/plugin/chat-params.ts (+16/-1) — read api.npm; gate reasoningEffort injection on native-openai npm
  • packages/omo-opencode/src/plugin/chat-params.test.ts (+103/-1) — 3 new test cases

Fixes #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.

  • Bug Fixes
    • Gate reasoningEffort to native @ai-sdk/openai; strip it for @ai-sdk/openai-compatible and other non-native providers to avoid /v1/chat/completions tools + reasoning_effort errors. Preserve behavior when model.api.npm is missing; added tests.
    • Unblock CI by whitelisting aside.md and motherduck.md in designOriginals within packages/shared-skills provenance checks.

Written for commit fec23ec. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added the opencode OpenCode edition: packages/omo-opencode label Jun 24, 2026
…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.
@EvangelosMoschou EvangelosMoschou force-pushed the fix/5529-reasoning-effort-openai-compatible branch from 3e554e9 to fec23ec Compare June 24, 2026 13:47
@github-actions github-actions Bot added the shared-skills Changes under packages/shared-skills label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

opencode OpenCode edition: packages/omo-opencode shared-skills Changes under packages/shared-skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gpt-5.5 with openai-compatible provider fails: reasoningEffort injected unconditionally causes tools + reasoning_effort conflict

1 participant