fix: restore responsive Bash foreground waits

This commit is contained in:
zksnet authored and 叫我小杨同学 committed 2026-10-11 01:53:44 +08:00
1 parent c04d750ace
commit 723b276e6f
6 files changed
+151 -15

No files matched your search

+11 -13
View File
@@ -3099,25 +3099,23 @@ const NEW_TOOL_PATCHES = [
markers: ["[dsh-purge] tool-result pruning disabled"],
},
{
id: 21, name: "BASH_TIMEOUT_RAISED", layer: "代码", layer_en: "Code",
desc: "bash 超时 60s → 10min / bash timeout raised",
id: 21, name: "BASH_TIMEOUT_RESTORE", layer: "代码", layer_en: "Code",
desc: "恢复插件延长的 bash 等待 / restore plugin-raised bash wait",
file: "base",
rel: ["cordis.patch.yml"],
// Migration only: clean installs and custom timeouts need no changes.
softSettle: true,
replacements: [
{
// 幂等性:原 pattern 以 `timeoutMs: 60000` 结尾,替换产物 `600000` 仍然
// 包含它,于是每次 autoApplyOnStart 都会再拼一个 0(实测已涨到
// 600000000000000)。
// 现在的做法:锚在 bash-sandbox 行内,`[^\n]*` 必须吃到行尾 —— 这样上一次
// 追加的注记会被整体重写而不是再叠一层,数值也不再有可再匹配的"前缀"。
// 这条是带 g 的模块级正则,匹配和写入都要克隆后再用,否则 lastIndex 残留会导致永远 pending。
// YAML 只认 #。写成 // 时从数字到行尾都是字符串,timeoutMs 校验失败,宿主起不来。
// [^\n]* 会把已经写成 // 的那一行整段重写成下面的 # 版本。
pattern: /(name: '@deepseek-ai\/dsh-bash-sandbox'[\s\S]*?\n {8}timeoutMs: )6[0-9]+[^\n]*/g,
replace: "$1600000 # [dsh-purge] bash timeout raised",
// Bash calls are exclusive in DSH. Raising this foreground wait to
// 10 minutes also blocked every later call in the same tool batch.
// Undo only marked plugin values, including the old extra-zero bug.
// Unmarked values or a user's changed value remain untouched. Bound
// the match to this entry so a missing timeout cannot reach the next.
pattern: /(name: ['"]@deepseek-ai\/dsh-bash-sandbox['"][^\n]*\n(?:(?! {0,4}\S)[^\n]*\n)*? {8}timeoutMs: )60{5,}[ \t]*(?:#|\/\/)[ \t]*\[dsh-purge\] bash timeout raised[ \t]*(?=\n|$)/g,
replace: "$160000",
},
],
markers: ["timeoutMs: 600000 # [dsh-purge] bash timeout raised"],
},
{
id: 22, name: "READ_CAPS_RAISED", layer: "代码", layer_en: "Code",