Skip to content
← Back to activity

Public problem

Cerebras reasoning model returns reasoning in content key instead of reasoning key

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

I am using qwen-3-235b-a22b-thinking-2507 with the async Cerebras client and streaming. The reasoning tokens show up in the content key of each chunk instead of a reasoning key. Is this a bug?

Related approaches to try.

Recommendations to evaluate. An outcome for this problem has not been reported.

Cerebras reasoning models put reasoning in content, not a reasoning key

  • Related public instructions; check applicability and missing conditions.

Shows how to fix cerebras reasoning models put reasoning in content, not a reasoning key. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

Using qwen-3-235b-a22b-thinking-2507 with the async Cerebras client and streaming: reasoning tokens show up in the content key of each chunk instead of a reasoning key. Do not wait for a fix or file it as a bug; the API is behaving as designed.

Steps

  1. If you need the reasoning separated out, parse the think blocks yourself on the

client side: extract everything between the think markers as reasoning and treat the rest as the final answer. Do not wait for a fix or file it as a bug; the API is behaving as designed.

When to use

You are seeing this: No, this is expected behavior. Use this skill when you run into "Cerebras reasoning models put reasoning in content, not a reasoning key".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

A user asked whether it is a bug that the Cerebras reasoning model qwen-3-235b-a22b-thinking-2507 returns reasoning tokens in the content key instead of a reasoning key when streaming. The verified resolution: this is expected behavior, only gpt-oss-120b puts reasoning in a separate reasoning key; every other reasoning model returns reasoning tokens alongside content tokens wrapped in think tags, so parse the think blocks client-side if you need them separated. Thread: https://vectle.com/threads/thr_xYvkcb8z64JF3Bt4PRCrFA

By @issueatlas · Version 2 · Exact version

Cerebras qwen-3-235b-thinking emits only closing think tag, no opening tag

  • Related public instructions; check applicability and missing conditions.

Shows how to fix cerebras qwen-3-235b-thinking emits only closing think tag, no opening tag. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

That is normal for this model. qwen-3-235b-a22b-thinking-2507 supports only thinking mode, and its default chat template automatically includes the opening [think] tag. So the model output legitimately contains only the closing [/think] without an explicit opening tag.

Steps

  1. That is normal for this model. qwen-3-235b-a22b-thinking-2507 supports only thinking mode, and its default chat template automatically includes the opening [think] tag. So the model output legitimately contains only the closing [/think] without an explicit opening tag. It is a template difference between the two models, not something wrong with your streaming code.

When to use

You are seeing this: qwen-3-32b streams reasoning wrapped in both [think] and [/think] tags, but qwen-3-235b-a22b-thinking-2507 only emits a closing [/think] with no opening tag. Use this skill when you run into "Cerebras qwen-3-235b-thinking emits only closing think tag, no opening tag".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

A user asked: qwen-3-32b streams reasoning wrapped in both [think] and [/think] tags, but qwen-3-235b-a22b-thinking-2507 only emits a closing [/think] with no opening tag. Why the inconsistency? My parser expects matched pairs, so the missing opening tag breaks it. The verified answer: That is normal for this model. qwen-3-235b-a22b-thinking-2507 supports only thinking mode, and its default chat template automatically includes the opening [think] tag. So the model output legitimately contains only the closing [/think] without an explicit opening tag. It is a template difference between the two models, not something wrong with your streaming code. Thread: https://vectle.com/threads/thr_WjCiOUHRVKlsiUKoX3Oo9w

By @issueatlas · Version 2 · Exact version

KeyError 'content' caused by negative max_tokens from long tool output

  • Related public instructions; check applicability and missing conditions.

Shows how to fix keyError 'content' caused by negative max_tokens from long tool output. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

This issue usually appears after I run a custom tool I've designed for Super AGI. Fix it by trimming what your tool returns, raising the model's token limit, or both.

Steps

  1. Issue TransformerOptimus/SuperAGI#560 (closed, 9 comments): I am writing this issue to bring your attention to a recurring error I have encountered while working with your system. This issue usually appears after I run a custom tool I've designed for Super AGI. The tool is returning almost 200 lines of data. Logs show: errorcode=None errormessage="-3038 is less than the minimum of 1 - 'maxtokens'" errortype=invalidrequesterror, followed by KeyError: 'content'.
  2. The KeyError on 'content' is a downstream symptom. The real error is '-3038 is less than the minimum of 1 - maxtokens': SuperAGI computes maxtokens as tokenlimit - currenttokens - functiontokens, and a long tool output pushed it negative, which the API rejects. When you see this, your tool output ate the whole token budget. Fix it by trimming what your tool returns, raising the model's token limit, or both. The negative maxtokens error in the celery logs is the giveaway.

When to use

You are seeing this: Issue TransformerOptimus/SuperAGI#560 (closed, 9 comments): I am writing this issue to bring your attention to a recurring error I have encountered while working with your system. Use this skill when you run into "KeyError 'content' caused by negative max_tokens from long tool output".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

In gh:TransformerOptimus/SuperAGI#560 (SuperAGI), the issue reported was: Issue TransformerOptimus/SuperAGI#560 (closed, 9 comments): I am writing this issue to bring your attention to a recurring error I have encountered while working with your system. This issue usually appears after I run a custom tool I've designed for Super AGI. The tool is returning almost 200 lines of data. Logs show: errorcode=None errormessage="-3038 is less than the minimum of 1 - 'maxtokens'" errortype=invalidrequesterror, followed by KeyError: 'content'. The verified resolution from the thread: The KeyError on 'content' is a downstream symptom. The real error is '-3038 is less than the minimum of 1 - maxtokens': SuperAGI computes maxtokens as tokenlimit - currenttokens - functiontokens, and a long tool output pushed it negative, which the API rejects. When you see this, your tool output ate the whole token budget. Fix it by trimming what your tool returns, raising the model's token limit, or both. The negative maxtokens error in the celery logs is the giveaway. Source: mount the host path https at container path //github.com/TransformerOptimus/SuperAGI/issues/560

By @issueatlas · Version 2 · Exact version

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

This is expected behavior, not a bug. On Cerebras only gpt-oss-120b puts reasoning tokens in a separate reasoning key. Every other reasoning model produces reasoning tokens alongside the content tokens, so they come through in the content field wrapped in [think] tags. If you need the reasoning separated out, you will have to parse the [think] blocks yourself on the client side. Source: https://github.com/Cerebras/cerebras-cloud-sdk-python/issues/9

Source: https://github.com/Cerebras/cerebras-cloud-sdk-python/issues/9

Related problems

qwen-3-32b streams reasoning wrapped in both [think] and [/think] tags, but qwen-3-235b-a22b-thinking-2507 only emits a

Reported outcome: unknown

Using Qwen3 models through ChatOCIGenAI with LangChain tool calling, the tool calls are not parsed into AIMessage.tool_c

Reported outcome: unknown

Building a conversational RAG chatbot with create_retrieval_chain wrapped in RunnableWithMessageHistory (input_messages_

Reported outcome: unknown