Skip to content

Cloudflare provider ignores reasoning.effort, so gpt-oss on Workers AI can't be told to reason less #135

Closed

Description

@stackbilt-admin

What happens

LLMRequest.reasoning.effort is documented as "translated to provider-native params at call time", but on the Cloudflare provider it never reaches Workers AI:

  • canonicalToLLMRequest copies request.reasoning only into providerOptions.cerebras (dist/canonical.js, around line 191).
  • The Workers AI chat request built in dist/providers/cloudflare.js (around lines 745–770) sends messages, temperature, max_tokens, top_p and frequency_penalty, and nothing for reasoning.

So a caller can't lower the reasoning effort of @cf/openai/gpt-oss-20b or @cf/openai/gpt-oss-120b, which Workers AI accepts as reasoning: { effort: 'low' | 'medium' | 'high' }.

Why it matters

Reasoning tokens count against max_tokens. In a downstream app (version 1.23.0, pinned), an extraction-style prompt on @cf/openai/gpt-oss-20b at temperature 0.2 and 0.6 spent the whole 8,000-token budget on reasoning, with its trace repeating one line until the cap, and returned no answer text (finishReason: 'length', empty message). Measured 2026-11-06, one call per setting, on a ~900-token prompt. Adding "Reasoning: low" to the system prompt didn't change it. The app moved to gpt-oss-120b at temperature 0.8 to work around it.

Expected

On the Cloudflare provider, reasoning.effort maps to the Workers AI input for models that accept it (the gpt-oss family at least), and 'none' is rejected or ignored with a clear signal where unsupported. A test pins the mapping.

Related

#130 (Llama 3.3 reasoning: null schema drift) and #95 (separating reasoning from the message).

Activity

  1. added a commit that references this issue on Nov 6, 2026
    0a2dae1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions