From 5df05d92bde9cdbc30837d8d2fe7d0c45a8dc9f5 Mon Sep 17 00:00:00 2001 From: Indra Gunawan Date: Sat, 17 Oct 2026 06:19:04 +0700 Subject: [PATCH] vendor: resync deepcode-core to lessweb/deepcode-cli@03c7ebb reasoning_effort top-level fix was merged upstream (lessweb/deepcode-cli#370), so the local patch is dropped; the vendored engine also gains the upstream follow-up that type-casts 'max' effort in the edit tool's LLM helpers. markdown-it bump and README/vscode commits upstream do not touch the vendored core. Dependency versions unchanged. --- README.md | 6 ++--- vendor/deepcode-core/UPSTREAM.md | 7 +++--- .../src/common/openai-thinking.ts | 5 ++-- .../deepcode-core/src/tools/edit-handler.ts | 7 ++++-- .../patches/reasoning-effort-top-level.patch | 24 ------------------- 5 files changed, 14 insertions(+), 35 deletions(-) delete mode 100644 vendor/patches/reasoning-effort-top-level.patch diff --git a/README.md b/README.md index 939134e..5e47672 100644 --- a/README.md +++ b/README.md @@ -137,9 +137,9 @@ appends to it. Measured on the real API (2026-10-12): 91-98% cache hits on conti ## Reasoning effort -`low | high | max`, sent as top-level `reasoning_effort`. Upstream sends it inside `extra_body`, which the -Node OpenAI SDK passes through as a literal key and DeepSeek ignores; dsh patches this -(`vendor/patches/reasoning-effort-top-level.patch`). `--effort disabled` turns thinking off. +`low | high | max`, sent as top-level `reasoning_effort`. Upstream originally sent it inside `extra_body`, which the +Node OpenAI SDK passes through as a literal key and DeepSeek ignores; the fix was merged upstream +(lessweb/deepcode-cli#370) and ships in the vendored engine since `03c7ebb`. `--effort disabled` turns thinking off. ## Models diff --git a/vendor/deepcode-core/UPSTREAM.md b/vendor/deepcode-core/UPSTREAM.md index 72c3408..879c4ce 100644 --- a/vendor/deepcode-core/UPSTREAM.md +++ b/vendor/deepcode-core/UPSTREAM.md @@ -1,12 +1,13 @@ # Vendored: @vegamo/deepcode-core -- Source: https://github.com/lessweb/deepcode-cli/tree/857b58c12fed11bad90704a0e32767270a1784f8/packages/core -- Version: 0.4.3 (commit `857b58c12fed11bad90704a0e32767270a1784f8`) +- Source: https://github.com/lessweb/deepcode-cli/tree/03c7ebbfa1b7129628c30a3abbcbb776aa04ac1a/packages/core +- Version: 0.4.3 (commit `03c7ebbfa1b7129628c30a3abbcbb776aa04ac1a`) - License: MIT (see LICENSE) - Copied: `src/` (without `src/tests/`) and `templates/`. - Local patches in `vendor/patches/` (applied by the sync script): - - `reasoning-effort-top-level.patch`: `reasoning_effort` sent top level instead of `extra_body` (DeepSeek ignores `extra_body` from the Node SDK; upstream bug). - `scrub-api-key.patch`: the bash tool's shell no longer inherits `DEEPCODE_API_KEY`, `DEEPCODE_PLUS_API_KEY` or the stripped `API_KEY`/`PLUS_API_KEY` from settings env. +- Retired patches, now upstream (keep the history here so a future re-vendor does not resurrect them): + - reasoning_effort top level instead of `extra_body`: merged upstream in lessweb/deepcode-cli#370 (commit `5954625`, present since vendored commit `03c7ebb`). - `orchestrator.patch`: `disallowedTools` setting (tool removed from schema and docs, refused if called), and a lock file + atomic write for `sessions-index.json` so parallel runs in one project do not lose sessions. Why vendored: `@vegamo/deepcode-core` is not published on npm. diff --git a/vendor/deepcode-core/src/common/openai-thinking.ts b/vendor/deepcode-core/src/common/openai-thinking.ts index 09beb4e..fe2fe94 100644 --- a/vendor/deepcode-core/src/common/openai-thinking.ts +++ b/vendor/deepcode-core/src/common/openai-thinking.ts @@ -6,9 +6,8 @@ type ThinkingConfig = { type ThinkingRequestOptions = { thinking?: ThinkingConfig; - // dsh patch: top level, not `extra_body`. The Node OpenAI SDK sends `extra_body` as a literal - // JSON key, which the DeepSeek API ignores (verified 2026-10-12: a bogus top-level value is - // rejected with 422, a bogus `extra_body.reasoning_effort` is accepted with 200). + // Top level, not `extra_body`: `extra_body` is a Python-SDK convention. The Node OpenAI SDK sends it + // as a literal JSON key, which the DeepSeek API ignores. reasoning_effort?: ReasoningEffort; }; diff --git a/vendor/deepcode-core/src/tools/edit-handler.ts b/vendor/deepcode-core/src/tools/edit-handler.ts index fd2e124..4f4fec0 100644 --- a/vendor/deepcode-core/src/tools/edit-handler.ts +++ b/vendor/deepcode-core/src/tools/edit-handler.ts @@ -1,5 +1,6 @@ import * as fs from "fs"; import { z } from "zod"; +import type { ChatCompletionCreateParamsNonStreaming } from "openai/resources/chat/completions"; import { buildThinkingRequestOptions } from "../common/openai-thinking"; import type { ToolExecutionContext, ToolExecutionResult } from "./executor"; import { @@ -662,6 +663,7 @@ async function inferOldStringNotFoundReasonWithLLM( try { context.signal?.throwIfAborted(); + // DeepSeek supports "max", which is absent from the OpenAI SDK types. const response = await client.chat.completions.create( { model, @@ -692,7 +694,7 @@ async function inferOldStringNotFoundReasonWithLLM( }, ], ...buildThinkingRequestOptions(thinkingEnabled, baseURL, reasoningEffort), - }, + } as ChatCompletionCreateParamsNonStreaming, { signal: context.signal } ); context.signal?.throwIfAborted(); @@ -748,6 +750,7 @@ async function correctEscapedStringsWithLLM( try { const problemDescription = describeCorrectionProblems(oldString, matchedText); context.signal?.throwIfAborted(); + // DeepSeek supports "max", which is absent from the OpenAI SDK types. const response = await client.chat.completions.create( { model, @@ -777,7 +780,7 @@ async function correctEscapedStringsWithLLM( }, ], ...buildThinkingRequestOptions(thinkingEnabled, baseURL, reasoningEffort), - }, + } as ChatCompletionCreateParamsNonStreaming, { signal: context.signal } ); context.signal?.throwIfAborted(); diff --git a/vendor/patches/reasoning-effort-top-level.patch b/vendor/patches/reasoning-effort-top-level.patch deleted file mode 100644 index 13eec36..0000000 --- a/vendor/patches/reasoning-effort-top-level.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/src/common/openai-thinking.ts -+++ b/src/common/openai-thinking.ts -@@ -6,9 +6,10 @@ - - type ThinkingRequestOptions = { - thinking?: ThinkingConfig; -- extra_body?: { -- reasoning_effort?: ReasoningEffort; -- }; -+ // dsh patch: top level, not `extra_body`. The Node OpenAI SDK sends `extra_body` as a literal -+ // JSON key, which the DeepSeek API ignores (verified 2026-10-12: a bogus top-level value is -+ // rejected with 422, a bogus `extra_body.reasoning_effort` is accepted with 200). -+ reasoning_effort?: ReasoningEffort; - }; - - export function buildThinkingRequestOptions( -@@ -20,6 +21,6 @@ - - return { - thinking, -- ...(thinkingEnabled ? { extra_body: { reasoning_effort: reasoningEffort } } : {}), -+ ...(thinkingEnabled ? { reasoning_effort: reasoningEffort } : {}), - }; - }