Skip to content

LongCat reasoning toggle falls back to unsupported OpenAI effort variants #47871

Closed as not planned

Description

@ffyuuu

Description

The direct LongCat provider declares binary reasoning in models.dev, but OpenCode's reasoningToggle() only handles Alibaba and Cohere. LongCat falls back to generic effort variants, so requests omit the documented thinking.type toggle. Selecting off cannot explicitly disable thinking.

LongCat expects thinking: {"type":"disabled"} or {"type":"enabled"}, not reasoning_effort. Reference: https://longcat.chat/platform/docs/zh/api/chat

OpenCode version

Current dev at ecbc6cc.

Steps to reproduce

  1. Normalize the models.dev longcat provider with Provider.fromModelsDevProvider.
  2. Pass its none/high variant through ProviderTransform.providerOptions and the actual @ai-sdk/openai-compatible client.
  3. Capture the outgoing JSON: thinking is absent for both states.

A regression using SDK request capture reproduces this without a live API key. A small fix is prepared that maps the first-party LongCat toggle to none/high and preserves other SDK/provider behavior.

Operating System

macOS

AI assistance: Codex helped investigate, implement, and test this report's fix.

Activity

  1. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed report and for preparing a fix!

    The commit you tested (ecbc6ccac85b) is from before v2 replaced the old code on dev. At that commit the opencode package is version 1.18.29, and ProviderTransform / reasoningToggle() are part of OpenCode v1. v2 (@opencode/cli, versions 2.x) is a completely separate implementation that is now on dev.

    v1 only gets fixes for critical bugs, such as data loss, security problems, or crashes or breakage with no workaround. Not being able to turn LongCat's thinking off from the variant picker doesn't meet that bar, so this is unlikely to be fixed in v1. As a workaround you could try setting the thinking option for that model in your provider config (untested).

    We'd encourage you to try v2 (npm i -g @opencode/cli). If LongCat's thinking.type toggle is also wrong there, or if you think this is critical, please reply here with your opencode --version and what you see.

  3. opencodejr commented on Oct 29, 2026

    @opencodejr

    Closing this as not planned. The missing LongCat thinking.type toggle is in v1's reasoningToggle() (1.18.x), and v1 only gets critical fixes. We didn't hear back that it's critical or that it also happens on v2.

    Thanks again for the detailed analysis. If you see the same problem on v2 (@opencode/cli, 2.x), please open a new issue and include your opencode --version and the outgoing request you see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions