Skip to content

Accept standard reasoning_effort / output_config.effort as effort source#520

Open
Blue-B wants to merge 1 commit into
rynfar:mainfrom
Blue-B:feat/reasoning-effort-source
Open

Accept standard reasoning_effort / output_config.effort as effort source#520
Blue-B wants to merge 1 commit into
rynfar:mainfrom
Blue-B:feat/reasoning-effort-source

Conversation

@Blue-B
Copy link
Copy Markdown

@Blue-B Blue-B commented May 28, 2026

What

Read the standard OpenAI reasoning_effort body field (and Anthropic-style output_config.effort) as an effort source, in addition to the existing effort / x-opencode-effort.

Why

OpenAI-compatible clients (e.g. pi, and the OpenAI SDK generally) send the reasoning level as reasoning_effort in the request body. Meridian only read effortHeader (x-opencode-effort) and body.effort, so the effort coming from standard clients was silently dropped and never forwarded to the SDK — every request effectively ran at the model default regardless of the client's chosen level.

Change

src/proxy/server.ts:

const effort = effortHeader
  || body.effort
  || body.reasoning_effort        // standard OpenAI field
  || body.output_config?.effort   // Anthropic-style nesting
  || undefined

Notes

  • Purely additive and backward compatible: existing effort / x-opencode-effort keep priority; the new fields are fallbacks.
  • body is any (from c.req.json()), so no type changes are required.
  • Verified end-to-end: with this change, a client sending reasoning_effort: "xhigh" (or max) reaches the Claude Code SDK --effort flag (confirmed by the SDK validating the value: it must be one of: low, medium, high, xhigh, max).

…rt source

OpenAI-compatible clients send the reasoning level via the standard
`reasoning_effort` body field (and newer Anthropic-style clients via
`output_config.effort`). The proxy previously only read `effort` /
`x-opencode-effort`, so effort from standard clients was silently dropped.
Fall through to these fields so their effort reaches the SDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant