Hy4 Flash vs DeepSeek V4.1 Flash: How is reasoning_content passed back after the same round of tool calls?

Hy4 Flash vs DeepSeek V4.1 Flash: How is reasoning_content passed back after the same round of tool calls?

Summary: This article explains how the two providers’ native Chat Completions endpoints return reasoning_content during client-side function calling, and how to catch missing, misordered, or mismatched fields locally. Facts verified on 2026-11-25 (Beijing time).

Within a single tool-call round, both providers converge on the same pattern: take the assistant message that carries tool_calls, put it back into messages verbatim, content and reasoning_content included, immediately append the tool message whose ID matches, then fire the next request. reasoning_content stays inside the original assistant message object — it doesn’t go into the tool result, and it doesn’t go at the top level of the request.

The real differences start once that round ends. DeepSeek explicitly requires follow-up requests that carry tools to keep sending the full historical reasoning field, including through the next user question; missing or incorrectly filled values return HTTP 400 per the docs [3]. Tencent’s guide says slow-thinking tool calls must be filled back on every round until the final answer [1]; the materials this article draws on don’t say how the next user turn should be handled.

hy4-flash-vs-deepseek-v4-1-flash-reasoning-content-tool-calls-en-image-0

reasoning_content Pass-Back Knowledge Map


hy4-flash-vs-deepseek-v4-1-flash-reasoning-content-tool-calls-en-image-1

The diagram’s main line is a loop: save the assistant message (1.1), backfill by ID if there are tool calls (1.2), then make another request; if there are no tool calls, the turn ends. The branch after it ends depends on the provider and whether tools is included—see 2.1 and 2.2. Sections 3, 4, and 5 cover implementation, troubleshooting, and acceptance, respectively.

reasoning_content Body Index and Reading Order

  • Section 1 lays out the shared message order, which serves as the foundation for the sections that follow.
  • Section 2 compares when to use Hy4 Flash versus DeepSeek V4.1 Flash, which determines how long historical fields need to be retained.
  • Section 3 translates the requirements into saving, streaming concatenation, and recovery.
  • Section 4 is a standalone reference you can consult when something goes wrong.
  • Section 5 uses local fixtures to check the implementation described earlier, without connecting to a real business system.

reasoning_content To Know

Term Brief explanation
tool_calls The list of function calls in an assistant message; each entry has its own id
tool_call_id The identifier in a tool message that points to the call it responds to
User turn Everything from one user question to the final answer, which may include several model requests in between
Tool loop The process where the model initiates a call, the client backfills it, and the model continues
mock transport A test transport layer that sends no network requests and only captures request objects

1. Common Message Order for reasoning_content After Tool Calls

1.1 Keep reasoning_content in the Original Assistant Message

When you get back a response with tool_calls, archive the complete assistant message first, and only then run the approved tools. At a minimum, keep three fields: content, reasoning_content, and tool_calls. If you extract only role and content, you end up with a message history that looks fine but is actually incomplete.

Here’s a constructed example of a test ticket lookup. All values are illustrative only; no real API was called.

[
  {"role": "user", "content": "工单 C17 处于什么状态?"},
  {
    "role": "assistant",
    "content": "",
    "reasoning_content": "(原样保存的思考文本)",
    "tool_calls": [{
      "id": "call_a",
      "type": "function",
      "function": {
        "name": "lookup_case",
        "arguments": "{\"case_id\":\"C17\"}"
      }
    }]
  },
  {
    "role": "tool",
    "tool_call_id": "call_a",
    "content": "{\"status\":\"open\"}"
  }
]

Here, arguments is a JSON string, and the tool’s object result has also been encoded as a string. The next request carries all messages so far, along with the corresponding tool definitions.

1.2 Backfill Tool Results by ID After reasoning_content

Each tool message’s tool_call_id must equal the matching tool_calls[i].id from the original assistant message. When one assistant message returns two calls in parallel, collect both results, bind each to its own ID, and then continue by requesting the model again.

If the model then calls an evidence lookup tool, save the second assistant message and append its tool results, leaving the earlier message order unchanged. Loop until a final answer comes back, or until you hit the call limit set on the application side.

hy4-flash-vs-deepseek-v4-1-flash-reasoning-content-tool-calls-en-image-2

There are two correspondences to watch for in the diagram above: assistant A appears in full in the next request, and the two call_a references point to the same call. If either one breaks, the history no longer satisfies the protocol.

2. reasoning_content conditions for Hy4 Flash and DeepSeek V4.1 Flash

Both use the same message structure described above, yet the two vendors’ documentation covers different ground. The table below compares only client-side function calling in Chat Completions from the two first-party providers — Tencent Cloud TokenHub and DeepSeek — with a data date of 2026-11-25.

Comparison item Hy4 Flash DeepSeek V4.1 Flash
Catalog name hy4-flash [2] deepseek-flash, currently pointing to DeepSeek-V4.1-Flash-1017 [4]
Field location Assistant messages in messages Assistant messages in messages
Same tool loop The guide requires slow-thinking tool calls to be echoed back each round until the final answer [1] Fully passed back whenever tools are included [3]
Assistant output that didn’t trigger a tool Not covered in this article’s materials Must still be passed back on the path that includes tools [3]
Next user turn Not covered in this article’s materials Subsequent requests that include tools must still pass it back [3]
Ordinary multi-turn without tools Not covered in this article’s materials The documentation example states that historical reasoning text is ignored [3]
Consequence of omitting it No error code given in this article’s materials The documentation specifies an HTTP 400 [3]

2.1 The Basis for reasoning_content in Hy4 Flash

The TokenHub model catalog lists retained reasoning and Function Calling for hy4-flash [2]. The Hunyuan invocation guide uses hy4 to demonstrate reasoning_effort: "high" and requires tool backfill requests to retain the previous assistant message’s reasoning_content [1]. The example model differs from the model discussed in this article, so applying this structure to hy4-flash is an adaptation inferred from the catalog’s capabilities and the general guide. Before launch, you should verify the current documentation for the corresponding model.

gavin1024, an author in the Tencent Cloud Developer Community, recorded on 2026-11-17 that their Bot missed this field in the Hy4 Flash tool backfill logic, and that a break in reasoning occurred before it was added back [6]. This is a personal account. It can help you identify symptoms, but it can’t prove that every omission will produce the same result, nor can it replace the vendor’s protocol.

2.2 The reasoning_content Branch for DeepSeek V4.1 Flash

DeepSeek should be handled according to the request path. For thinking-mode requests that carry tools, the historical thinking field must be sent back in full on subsequent turns, even if a given assistant output didn’t trigger a tool. The official example still sends the first turn’s field on the second user turn [3].

For plain multi-turn conversations without tools, the documentation example states that historical thinking text is ignored [3]. This note applies only to the no-tool branch. Applying it to sessions that carry tool definitions could cause the required field to be dropped on the second user question.

hy4-flash-vs-deepseek-v4-1-flash-reasoning-content-tool-calls-en-image-3

For a shared adapter layer, a more conservative engineering strategy can be used: assistant messages in tool sessions are saved losslessly by default, and the vendor’s policy then determines how the request is projected. This is an implementation recommendation based on the differences; it should not be written as a hard requirement from Tencent for cross-turn pass-back.

3. Fully Preserve reasoning_content in the Adapter Layer

3.1 Guard reasoning_content with a Structure Checker

The Python example below doesn’t depend on a vendor SDK and sends no network requests. It assembles one round of tool results and checks the reasoning field, message adjacency, and call IDs.

import copy

def append_tool_round(history, assistant, results):
    """results: {tool_call_id: JSON string}"""
    calls = assistant.get("tool_calls") or []
    ids = [call["id"] for call in calls]
    if len(ids) != len(set(ids)) or set(ids) != set(results):
        raise ValueError("tool results do not match tool_calls")

    new_history = copy.deepcopy(history)
    new_history.append(copy.deepcopy(assistant))
    for call_id in ids:
        new_history.append({
            "role": "tool",
            "tool_call_id": call_id,
            "content": results[call_id],
        })
    return new_history

def check_history(messages, require_reasoning):
    errors, i = [], 0
    while i < len(messages):
        msg = messages[i]
        if msg["role"] == "tool":
            errors.append(f"{i}: orphan tool message")
            i += 1
            continue
        if msg["role"] != "assistant":
            i += 1
            continue

        pos = i
        if require_reasoning and msg.get("reasoning_content") is None:
            errors.append(f"{pos}: missing reasoning_content")
        expected = [c["id"] for c in msg.get("tool_calls") or []]
        i += 1
        actual = []
        while i < len(messages) and messages[i]["role"] == "tool":
            actual.append(messages[i].get("tool_call_id"))
            i += 1
        if sorted(map(str, actual)) != sorted(expected):
            errors.append(f"{pos}: tool_call_id mismatch")
    return errors

require_reasoning is a local policy switch: set it to true for the DeepSeek thinking-mode path that carries tools, and handle the no-tool path separately. Because it checks every assistant message, when you use it on Tencent’s cross-turn history you should treat it as your application’s own conservative check. The checker only confirms the field exists — whether the original text has been rewritten still requires an item-by-item comparison against the archived value.

3.2 Concatenate reasoning_content and Arguments in Streaming Responses

Streaming adapters need to accumulate reasoning and body text from their respective delta fields, and function arguments by tool-call index. A single argument fragment may contain only half a key name, so you can’t parse it the moment it arrives.

def merge_arguments(deltas):
    parts = {}
    for item in deltas:
        index = item["index"]
        parts[index] = parts.get(index, "") + item["arguments"]
    return parts

Wait until the full assistant message closes before validating the arguments and executing the tool. Some SDKs put vendor extension fields into extra attributes, so being able to see the reasoning text in the debug UI doesn’t prove the next request carried it. The check should land on the final outgoing JSON.

3.3 Protect reasoning_content During Truncation and Recovery

A segment of tool history consists of the assistant call plus the results that follow it, and you can’t split them when truncating. While the loop is still running, keep the original message frame — don’t replace the assistant message awaiting tool results with a summary. For DeepSeek paths that use tools, you also can’t delete the field and expect the next request to implicitly recover it.

If compression is truly necessary, you can summarize the completed business state into a summary, start a new conversation from the corresponding user input, and label the two runs separately. For service recovery, check whether the checkpoint contains both the assistant message and the persisted tool results. The UI can display only the final answer, but the protocol state should still be stored separately by the adapter layer, within the bounds of authorized storage.

4. Troubleshooting reasoning_content Round-Trips by Symptom

Start with the actual request object, then compare hop by hop along SDK decoding, message archiving, serialization, HTTP adaptation, and the final request dispatch. Log only the message index, role, call ID, whether the field is present, and its length — that’s usually enough to pinpoint which step dropped the field, and it keeps sensitive text from being exposed.

Symptom Check first What to do
Model side returns HTTP 400 Error details, model, endpoint, and the historical tool section Check the reasoning field and ID entry by entry; don’t judge the cause from the status code alone
Reasoning gaps in the reply Whether the previous assistant message is complete Compare the fields at both the archiving and dispatch stages
Looks like the query is being executed twice Duplicate consumption of deltas, response replay, or ID association Check execution and persistence records by call ID
The tool itself fails Whether there’s an error result for the corresponding ID Fill in an understandable error and let the application distinguish retries from manual handling
Fails only on the second question Whether the first-turn history fields were stripped Restore the full history when DeepSeek carries tools

Before resending over the network, check whether the tool result has already been persisted. For operations with side effects, use a business idempotency key to prevent duplicate submission. For protocol acceptance testing, read-only tools are enough.

5. Validating reasoning_content with 4 Fixture Types

Fixture How It’s Built Pass Condition
Single tool Assistant message contains all fields Assistant and tool messages are adjacent in the request, field values unchanged
Parallel tools Two calls with interleaved parameter deltas Parameters restored by index, each result bound to its own ID, and execution continues only after everything is collected
Two user turns Both turns carry tool definitions; the first turn calls a tool and then ends with body text In DeepSeek’s second turn, every earlier assistant message has complete fields
Malformed structure Remove the reasoning field or swap the tool index The client raises the corresponding structural error before sending the request

The third fixture must include that last assistant message from the first turn — the one with no tool_calls. Some SDKs omit the tool array here, and the persistence layer may drop the reasoning field along with it. The test should have the mock transport capture the second-turn request and compare it against the archived original values.

Add one more interruption-recovery test: stop the process after the tool results are written, build the next request from the checkpoint, and confirm that the assistant message and all results are still there — and that the tool didn’t run a second time.

Final acceptance boils down to a single check: open the JSON captured by the mock transport, and every tool result should be able to find its preceding call, while every reasoning_content that policy says to retain should match the value first received. Local fixtures can verify message structure, but they can’t replace online compatibility testing against the target model; no such live testing was performed for this article.

reasoning_content References

  1. Hunyuan invocation guide: cloud.tencent.com/document/product/1823/132252
  2. TokenHub model list: cloud.tencent.com/document/product/1823/130051
  3. DeepSeek thinking mode guide: api-docs.deepseek.com/guides/thinking_mode/
  4. DeepSeek models and pricing: api-docs.deepseek.com/quick_start/pricing/
  5. DeepSeek Chat Completions reference (Section 3.2, streaming chunks): api-docs.deepseek.com/api/create-chat-completion/
  6. gavin1024’s public developer write-up: cloud.tencent.com/developer/article/2786341

Related Articles

Similar Posts