zai-org / zai-org/feedback

Custom provider reasoning effort not injected: OpenAI camelCase vs snake_case; Anthropic output_config dropped

Open
#306 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Summary

Custom-provider reasoning effort is not reliably injected in ZCode 3.7.7.

  • OpenAI-compatible path: ZCode sends camelCase reasoningEffort, while DeepSeek/Kimi document snake_case reasoning_effort; servers return 200 but silently ignore the unknown field, so low/high/max does not actually change behavior.
  • Anthropic-compatible path: the catalog writes output_config.effort, but the main request injector only reads top-level effort/reasoningEffort, so output_config is dropped from real chat requests; high and max produce the same request. The connectivity test masks this by falling back to thoughtLevel.
  • thinking.type: "disabled" is omitted by the Anthropic main-path injector, so the off state depends on endpoint defaults.

Environment

  • ZCode: 3.7.7 win-x64
  • OS: Windows 11 build 26200
  • Providers/models: Kimi Code k3 (https://api.kimi.com/coding/v1, OpenAI-compatible), DeepSeek deepseek-v4-flash (https://api.deepseek.com and https://api.deepseek.com/anthropic)

Official parameter references

  • DeepSeek chat: thinking.type enabled/disabled default enabled; reasoning_effort low/high/max default high; response uses reasoning_content.
  • DeepSeek Anthropic endpoint: thinking supported but budget_tokens ignored; output_config only supports effort.
  • Kimi K3: top-level reasoning_effort low/high/max default max; K3 always thinks; max_completion_tokens default 131072 / max 1048576.
  • Kimi Code API documents OpenAI-compatible base https://api.kimi.com/coding/v1 and Anthropic-compatible base https://api.kimi.com/coding/; it does not rename reasoning to camelCase.

Evidence

  • Installed catalog resources/model-providers/models_catalog_china_llm_zcode_2026-06-03.json maps openai-compatible reasoning to reasoningEffort; Anthropic effort is nested at ["output_config","effort"].
  • Connectivity logs under %USERPROFILE%\.zcode 2\logs show OpenAI-compatible probes sending "reasoningEffort":"max"; Anthropic probes show output_config.effort only because the connectivity builder falls back to thoughtLevel.
  • Rollout records under %USERPROFILE%\.zcode\cli ollout show real chat behavior differs from connectivity probes. After locally patching only the catalog key to reasoning_effort, real Kimi k3 requests separate correctly: low reasoningTokens 44/189 vs max reasoningTokens 495/475 in repeated checks.

Expected

  • OpenAI-compatible providers receive reasoning_effort (or a provider-correct field), not reasoningEffort.
  • Anthropic main requests read providerOptions.anthropic.output_config?.effort or the catalog maps to top-level effort; thinking.type:"disabled" is explicitly sent.
  • Connectivity tests use the exact same injection path as real chat requests.

Actual

  • UI level changes are accepted but can be silently ignored by providers.
  • Anthropic high/max real requests are identical; connectivity test can look healthy while the real request drops output_config.

Suggested minimal catalog patch for the OpenAI-compatible key

This patch fixed the OpenAI-compatible path locally. It is against the installed resource file; the source path may differ.

zcode-reasoning-effort-snake-case.patch
diff --git a/resources/model-providers/models_catalog_china_llm_zcode_2026-06-03.json b/resources/model-providers/models_catalog_china_llm_zcode_2026-06-03.json
--- a/resources/model-providers/models_catalog_china_llm_zcode_2026-06-03.json
+++ b/resources/model-providers/models_catalog_china_llm_zcode_2026-06-03.json
@@ -51,7 +51,7 @@
                   "set": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "low"
                     }
@@ -74,7 +74,7 @@
                   "set": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "high"
                     }
@@ -97,7 +97,7 @@
                   "set": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "max"
                     }
@@ -145,7 +145,7 @@
                   "set": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "low"
                     }
@@ -168,7 +168,7 @@
                   "set": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "high"
                     }
@@ -191,7 +191,7 @@
                   "set": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "max"
                     }
@@ -239,7 +239,7 @@
                   "set": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "low"
                     }
@@ -262,7 +262,7 @@
                   "set": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "high"
                     }
@@ -285,7 +285,7 @@
                   "set": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "max"
                     }
@@ -764,7 +764,7 @@
                   "unset": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ]
                     }
                   ]
@@ -802,7 +802,7 @@
                     },
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "high"
                     }
@@ -841,7 +841,7 @@
                     },
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "max"
                     }
@@ -897,7 +897,7 @@
                   "unset": [
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ]
                     }
                   ]
@@ -935,7 +935,7 @@
                     },
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "high"
                     }
@@ -974,7 +974,7 @@
                     },
                     {
                       "path": [
-                        "reasoningEffort"
+                        "reasoning_effort"
                       ],
                       "value": "max"
                     }

Notes

  • I can provide redacted logs and a small direct-API repro script if needed.
  • Please treat connectivity success as insufficient validation for this bug; verify the real chat wire body or compare provider reasoning_content/reasoningTokens across low and max.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with resources/model-providers/models_catalog_china_llm_zcode_2026-06-03.json, then trace its settings through the real chat request injector and the connectivity builder. Compare rollout records under %USERPROFILE%.zcode\cli\rollout with connectivity logs under %USERPROFILE%.zcode\v2\logs. Done means real requests use provider-correct effort fields, preserve Anthropic output_config and disabled thinking, and connectivity exercises the same injection path.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.