Git Copilot claude 3.7 sonnet thinking is not working in the opencode CLI #1525

Closed
opened 2026-02-16 17:31:23 -05:00 by yindo · 14 comments
Owner

Originally created by @ru-aish on GitHub (Aug 29, 2025).

Originally assigned to: @rekram1-node on GitHub.

Even after toggling the thinking using '/thinking' it is giving this error::

Image
Originally created by @ru-aish on GitHub (Aug 29, 2025). Originally assigned to: @rekram1-node on GitHub. Even after toggling the thinking using '/thinking' it is giving this error:: <img width="1133" height="212" alt="Image" src="https://github.com/user-attachments/assets/d42b0373-defc-4161-ad53-14c8fbd1e1fa" />
yindo closed this issue 2026-02-16 17:31:23 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 29, 2025):

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

  • #1106: Similar issue with claude sonnet "thinking" model configuration
  • #2055: Bug with incorrect max_tokens calculation when "thinking" is enabled & "budgetTokens" is set for Anthropic models
  • #992: Related error with reasoning models - "stream=true" with structured outputs is currently not supported for reasoning models

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 29, 2025): This issue might be a duplicate of existing issues. Please check: - #1106: Similar issue with claude sonnet "thinking" model configuration - #2055: Bug with incorrect max_tokens calculation when "thinking" is enabled & "budgetTokens" is set for Anthropic models - #992: Related error with reasoning models - "stream=true" with structured outputs is currently not supported for reasoning models Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Aug 29, 2025):

@ru-aish just to confirm you are using claude-3.7-sonnet-thought correct?

I get errs w/ it too so I can help investigate this

@rekram1-node commented on GitHub (Aug 29, 2025): @ru-aish just to confirm you are using `claude-3.7-sonnet-thought` correct? I get errs w/ it too so I can help investigate this
Author
Owner

@ru-aish commented on GitHub (Aug 29, 2025):

Yep it claude-3.7-sonnet-thought used through copilot auth.

@ru-aish commented on GitHub (Aug 29, 2025): Yep it claude-3.7-sonnet-thought used through copilot auth.
Author
Owner

@rekram1-node commented on GitHub (Aug 29, 2025):

gotcha ill look into it

@rekram1-node commented on GitHub (Aug 29, 2025): gotcha ill look into it
Author
Owner

@fmatsos commented on GitHub (Sep 11, 2025):

Got a similar error message when I want to use this model too (without any configuration override):

AI_APICallError: messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable
`thinking`. Please consult our documentation at https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking

I wanted to use it in build mode.

@fmatsos commented on GitHub (Sep 11, 2025): Got a similar error message when I want to use this model too (without any configuration override): ```shell AI_APICallError: messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult our documentation at https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking ``` I wanted to use it in `build` mode.
Author
Owner

@Sewer56 commented on GitHub (Sep 11, 2025):

This also affects Sonnet 4 & Opus 4.1
Not just Sonnet 3.7.

Not only CoPilot but also directly via Anthropic.

@Sewer56 commented on GitHub (Sep 11, 2025): This also affects Sonnet 4 & Opus 4.1 Not just Sonnet 3.7. Not only CoPilot but also directly via Anthropic.
Author
Owner

@rekram1-node commented on GitHub (Sep 11, 2025):

@Sewer56 the only model I get this error with is sonnet 3.7 thought through copilot , are you getting this error with other models?

@rekram1-node commented on GitHub (Sep 11, 2025): @Sewer56 the only model I get this error with is sonnet 3.7 thought through copilot , are you getting this error with other models?
Author
Owner

@Sewer56 commented on GitHub (Sep 11, 2025):

@rekram1-node Yes, I've observed it in both of the current Claude 4 models (anthropic/claude-sonnet-4-20250514, anthropic/claude-opus-4-1-20250805) . Both on Copilot and Anthropic API. That's why I commented, as I figured it may be worth mentioning that the scope is larger than before stated.

@Sewer56 commented on GitHub (Sep 11, 2025): @rekram1-node Yes, I've observed it in both of the current `Claude 4` models (`anthropic/claude-sonnet-4-20250514`, `anthropic/claude-opus-4-1-20250805`) . Both on Copilot and Anthropic API. That's why I commented, as I figured it may be worth mentioning that the scope is larger than before stated.
Author
Owner

@rekram1-node commented on GitHub (Sep 12, 2025):

Can you provide a share link? I can use sonnet 4 with thinking just fine:
https://opencode.ai/s/KUzNz8HR

Do you have any special config?

@rekram1-node commented on GitHub (Sep 12, 2025): Can you provide a share link? I can use sonnet 4 with thinking just fine: https://opencode.ai/s/KUzNz8HR Do you have any special config?
Author
Owner

@Sewer56 commented on GitHub (Sep 12, 2025):

This tends to happen most often during long context.

I dug out the last time it happened from my local history. It was here https://opencode.ai/s/I4nxRe6B#msg_93bd5e186001Ig0apIjqRFxmHI-0 (when I was doing work stuff, as opposed to hobby stuff).

Image

(The error doesn't show in the share, so here it is)

That's really, really deep in- (sorry about that). Because the refinements weren't super complex I settled for auto-compact that one time 😅 .

I'm guessing it's somewhat related to Thinking -> Failed Tool Call.

@Sewer56 commented on GitHub (Sep 12, 2025): This tends to happen most often during long context. I dug out the last time it happened from my local history. It was here https://opencode.ai/s/I4nxRe6B#msg_93bd5e186001Ig0apIjqRFxmHI-0 (when I was doing work stuff, as opposed to hobby stuff). <img width="2106" height="729" alt="Image" src="https://github.com/user-attachments/assets/e44b86eb-a079-4355-9f01-edcae5a01bc3" /> (The error doesn't show in the share, so here it is) That's really, really deep in- (sorry about that). Because the refinements weren't super complex I settled for auto-compact that one time 😅 . I'm guessing it's somewhat related to `Thinking` -> `Failed Tool Call`.
Author
Owner

@rekram1-node commented on GitHub (Sep 12, 2025):

ahh gotcha maybe a compact issue if it only happens during long context

@rekram1-node commented on GitHub (Sep 12, 2025): ahh gotcha maybe a compact issue if it only happens during long context
Author
Owner

@Sewer56 commented on GitHub (Sep 12, 2025):

It could be an auto-compact at a bad moment; that's not unthinkable.
According to URL, was 54th message since last compact.

Wish the share link shown token usages at each message, aaaa.

@Sewer56 commented on GitHub (Sep 12, 2025): It could be an `auto-compact` at a bad moment; that's not unthinkable. According to URL, was 54th message since last compact. Wish the share link shown token usages at each message, aaaa.
Author
Owner

@rekram1-node commented on GitHub (Sep 12, 2025):

the share link does have tokens at each message it just isnt visible in ui, like when u share it makes a lil json object of the thread and it has tokens

@rekram1-node commented on GitHub (Sep 12, 2025): the share link does have tokens at each message it just isnt visible in ui, like when u share it makes a lil json object of the thread and it has tokens
Author
Owner

@rekram1-node commented on GitHub (Sep 18, 2025):

This is fixed on latest I tested a bit seems fixed

@rekram1-node commented on GitHub (Sep 18, 2025): This is fixed on latest I tested a bit seems fixed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1525