Merge pull request #9173 from deepseek-harness/turtle/fix-git-add-slow-77485ec18f43

fix(workspace-changes): give up a git command after 3 s instead of 30 s
This commit is contained in:
CreatixChu authored and GitHub committed 2026-11-25 14:08:34 +08:00
commit 70eff03284
7 files changed
+61 -5

No files matched your search

@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.3-alpha.2/workspace-changes-timeout/guide.md
/:
en: 7a2f7f6109b8b319
zh: f9e94429c08e8df1
/workspace-changes-give-up-a-git-command-after-3-seconds:
en: aee012e6a3556f45
zh: 4728c8f80e791237
/workspace-changes-give-up-a-git-command-after-3-seconds/change:
en: ec458c8b35f5c789
zh: 66f9a9dece38992d
/workspace-changes-give-up-a-git-command-after-3-seconds/migration:
en: fa92e5be40cc471d
zh: f5ae3b0c11d12997
@@ -0,0 +1,20 @@
---
kind: upgrade-guide
description: "workspace-changes.timeoutMs now defaults to 3000 instead of 30000, so a turn whose git command runs longer than 3 seconds gets no changed-files card."
---
# Workspace changes give up a git command after 3 seconds
English | [中文](guide.zh.md)
## Change
The `@deepseek-ai/dsh-workspace-changes` plugin terminated a git command after `timeoutMs`, which defaulted to `30000`. It now defaults to `3000`. Tool calls wait for the turn-start snapshot, so a working directory with many non-ignored untracked files no longer stalls each tool call for up to 30 seconds; when a snapshot or diff command exceeds 3 seconds, that turn records no changes and the Web shows no changed-files card for it. A per-file comparison opened from the card is also abandoned after 3 seconds.
Affected: Web and Desktop users whose repositories need more than 3 seconds for one snapshot command, such as large untracked content, a cold disk cache, or a slow filesystem. A `timeoutMs` set explicitly on the `workspace-changes` row is kept.
## Migration
1. To keep the previous bound, add `- {id: workspace-changes, config: {timeoutMs: 30000}}` to the profile patch `$DSH_HOME/profiles/<profile>/cordis.patch.yml`. Tool calls in such a repository then wait up to that long again.
2. To keep the card without the wait, add the large untracked directories to the repository's `.gitignore`.
3. Confirm with `dsh --profile <profile> --dump-config` that the `workspace-changes` row shows the intended `timeoutMs`.
@@ -0,0 +1,20 @@
---
kind: upgrade-guide
description: "workspace-changes.timeoutMs 默认值由 30000 改为 3000,单条 git 命令超过 3 秒的轮次不再显示改动文件卡片。"
---
# 工作区改动记录在 3 秒后放弃 git 命令
[English](guide.md) | 中文
## 变更
`@deepseek-ai/dsh-workspace-changes` 插件在 `timeoutMs` 后终止 git 命令,原默认值为 `30000`,现在为 `3000`。工具调用会等待轮初快照,因此工作目录里有大量未忽略的未跟踪文件时,每次工具调用不再卡住最多 30 秒;快照或 diff 命令超过 3 秒时,该轮不记录改动,Web 也不显示该轮的改动文件卡片。从卡片打开的单文件对比同样在 3 秒后放弃。
受影响的是单条快照命令需要 3 秒以上的仓库的 Web 与 Desktop 用户,例如含大量未跟踪内容、磁盘缓存为冷或文件系统较慢。在 `workspace-changes` 条目上显式设置的 `timeoutMs` 保持不变。
## 迁移
1. 如需保留原上限,在 profile patch `$DSH_HOME/profiles/<profile>/cordis.patch.yml` 中加入 `- {id: workspace-changes, config: {timeoutMs: 30000}}`。此后这类仓库中的工具调用会重新等待最多这么久。
2. 如需保留卡片又不等待,把大的未跟踪目录加入仓库的 `.gitignore`。
3. 用 `dsh --profile <profile> --dump-config` 确认 `workspace-changes` 条目显示预期的 `timeoutMs`。
@@ -15,8 +15,8 @@
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-workspace-changes/use-this-package:
en: 27239874e99bc94d
zh: 93b437cc02de2064
en: 38e467cfe33046a4
zh: 7ee9fb04c4316439
/deepseek-ai-dsh-workspace-changes/understand-the-implementation:
en: 9bfc66bea548bda2
zh: 7023c42cdb44569b
@@ -35,7 +35,7 @@ The shipped Web bundle mounts this plugin. Mount it in any composition with the
| Field | Default | Meaning |
|---|---|---|
| `timeoutMs` | `30000` | Milliseconds one git command may run before the turn's record is abandoned |
| `timeoutMs` | `3000` | Milliseconds one git command may run before the turn's record is abandoned |
| `outputMaxBytes` | `8388608` | Bytes of git output retained per command; a larger diff listing abandons the record |
| `maxFiles` | `500` | Maximum files carried by one summary; `total` still reports the complete count |
| `maxFileBytes` | `2097152` | Bytes a file may hold to be captured around a file-tool edit or read from a snapshot for its comparison; a larger file gets no comparison, and one captured around a file-tool edit is also listed without counts |
@@ -35,7 +35,7 @@ kind: "package-reference"
| 字段 | 默认值 | 含义 |
|---|---|---|
| `timeoutMs` | `30000` | 单条 git 命令允许运行的毫秒数,超时则放弃本轮记录 |
| `timeoutMs` | `3000` | 单条 git 命令允许运行的毫秒数,超时则放弃本轮记录 |
| `outputMaxBytes` | `8388608` | 每条命令保留的 git 输出字节数,diff 列表更大时放弃本轮记录 |
| `maxFiles` | `500` | 单份摘要携带的最大文件数;`total` 仍报告完整数量 |
| `maxFileBytes` | `2097152` | 文件在文件工具编辑前后被捕获、或从快照读出做对比所允许的最大字节数;更大的文件不提供对比,其中在文件工具编辑前后被捕获的也不带行数 |
@@ -50,7 +50,7 @@ export interface Config {
/** Schemastery validation for {@link Config}. */
export const Config: z<Config> = z.object({
timeoutMs: z.number().default(30_000),
timeoutMs: z.number().default(3_000),
outputMaxBytes: z.number().default(8 * 1024 * 1024),
maxFiles: z.number().default(500),
maxFileBytes: z.number().default(2 * 1024 * 1024),