fix: bash 超时正则每次克隆,避免 lastIndex 残留 (#35)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
叫我小杨同学andCursor committed 2026-09-24 10:34:38 +08:00
1 parent 111427b198
commit aedc58833f
1 file changed
+1
+1
View File
@@ -2229,6 +2229,7 @@ const NEW_TOOL_PATCHES = [
// 600000000000000)。
// 现在的做法:锚在 bash-sandbox 行内,`[^\n]*` 必须吃到行尾 —— 这样上一次
// 追加的注记会被整体重写而不是再叠一层,数值也不再有可再匹配的"前缀"。
// 这条是带 g 的模块级正则,匹配和写入都要克隆后再用,否则 lastIndex 残留会导致永远 pending。
pattern: /(name: '@deepseek-ai\/dsh-bash-sandbox'[\s\S]*?\n {8}timeoutMs: )6[0-9]+[^\n]*/g,
replace: "$1600000 // [dsh-purge] bash timeout raised",
},