anomalyco / anomalyco/opencode

LongCat reasoning toggle falls back to unsupported OpenAI effort variants

Open
#47,871 1 comment 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Sep 8, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

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

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.