Skip to content

Fully autonomous AI Agents system capable of performing complex penetration testing tasks

docs(providers): restore the DeepSeek legacy reasoning-format contract

Sergey Kozyrenko9876c13ea8f1
diff --git a/backend/pkg/providers/glm/config.yml b/backend/pkg/providers/glm/config.yml
index 9e4da043..3f8ca8dc 100644
--- a/backend/pkg/providers/glm/config.yml
+++ b/backend/pkg/providers/glm/config.yml
@@ -10,7 +10,7 @@
# on the standard API endpoint Z.AI defaults to clearing reasoning_content between
# turns, which hurts agent loops with tool calls. Setting clear_thinking=false
# preserves reasoning_content across turns, improving reasoning continuity and cache
-# hit rates. Required together with WithPreserveReasoningContent() in glm.go so that
+# hit rates. Required together with WithPreserveReasoningContent() in openaicompat.go so that
# langchaingo serializes reasoning_content back to the API.
#
# Note: langchaingo's IsReasoningModel matches glm-4.5/4.6/4.7 prefixes and force-
diff --git a/backend/pkg/providers/openaicompat/openaicompat.go b/backend/pkg/providers/openaicompat/openaicompat.go
index e61084d2..b5f7ad70 100644
--- a/backend/pkg/providers/openaicompat/openaicompat.go
+++ b/backend/pkg/providers/openaicompat/openaicompat.go
@@ -60,6 +60,10 @@ func New(
openai.WithBaseURL(spec.ServerURL),
openai.WithHTTPClient(httpClient),
}
+ // Do NOT add openai.WithModernReasoningFormat() to these shared opts: DeepSeek's
+ // API requires the legacy top-level "reasoning_effort" string, which langchaingo
+ // emits only while ModernReasoningFormat is off (the default). The modern
+ // "reasoning":{} object form breaks DeepSeek thinking mode.
if spec.PreserveReasoning {
opts = append(opts, openai.WithPreserveReasoningContent())
}
diff --git a/backend/pkg/providers/qwen/config.yml b/backend/pkg/providers/qwen/config.yml
index d2374bd2..0ed37d09 100644
--- a/backend/pkg/providers/qwen/config.yml
+++ b/backend/pkg/providers/qwen/config.yml
@@ -16,7 +16,7 @@
# - preserve_thinking=true: keeps reasoning_content from previous assistant turns
# in subsequent requests. Supported ONLY by qwen3.7-max and qwen3.6-plus families.
# Required for agent loops with tool calls to preserve reasoning continuity.
-# Works together with WithPreserveReasoningContent() in qwen.go.
+# Works together with WithPreserveReasoningContent() in openaicompat.go.
# - qwen3-coder-* (coder, installer) are NOT hybrid thinking models — no thinking
# control needed.