fix: preserve ReasoningContent in toolloop for thinking models
When using thinking models (e.g., Kimi K2.5), the API requires all assistant messages with tool calls to include reasoning_content. This field was missing in RunToolLoop, causing subagent failures with the error: 已启用思考功能,但索引2处的助手工具调用消息中缺少推理内容 Aligns toolloop.go with the existing handling in agent/loop.go.
This commit is contained in:
parent
39998a6618
commit
53ddf35b78
1 changed files with 3 additions and 2 deletions
|
|
@ -97,8 +97,9 @@ func RunToolLoop(ctx context.Context, config ToolLoopConfig, messages []provider
|
|||
|
||||
// 6. Build assistant message with tool calls
|
||||
assistantMsg := providers.Message{
|
||||
Role: "assistant",
|
||||
Content: response.Content,
|
||||
Role: "assistant",
|
||||
Content: response.Content,
|
||||
ReasoningContent: response.ReasoningContent, // Preserve for thinking models (e.g., GLM-Z1)
|
||||
}
|
||||
for _, tc := range response.ToolCalls {
|
||||
argumentsJSON, _ := json.Marshal(tc.Arguments)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue