Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions vendor/deepcode-core/UPSTREAM.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
5 changes: 2 additions & 3 deletions vendor/deepcode-core/src/common/openai-thinking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
7 changes: 5 additions & 2 deletions vendor/deepcode-core/src/tools/edit-handler.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -692,7 +694,7 @@ async function inferOldStringNotFoundReasonWithLLM(
},
],
...buildThinkingRequestOptions(thinkingEnabled, baseURL, reasoningEffort),
},
} as ChatCompletionCreateParamsNonStreaming,
{ signal: context.signal }
);
context.signal?.throwIfAborted();
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -777,7 +780,7 @@ async function correctEscapedStringsWithLLM(
},
],
...buildThinkingRequestOptions(thinkingEnabled, baseURL, reasoningEffort),
},
} as ChatCompletionCreateParamsNonStreaming,
{ signal: context.signal }
);
context.signal?.throwIfAborted();
Expand Down
24 changes: 0 additions & 24 deletions vendor/patches/reasoning-effort-top-level.patch

This file was deleted.

Loading