fix: 停用/卸载时清掉 selectedDefault=redteam(#108)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
叫我小杨同学andCursor committed 2026-10-24 14:42:42 +08:00
1 parent fefae8764c
commit 7a78399e0b
6 files changed
+77 -17

No files matched your search

+2
View File
@@ -11,6 +11,7 @@ import { homedir } from 'node:os'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { readPresetDefinition } from './preset-composition.js'
import { scheduleClearOwnedSelectedDefault } from '../preset-default.js'
/** Cordis 插件名。 */
export const name = 'dsh-purge-redteam'
@@ -605,6 +606,7 @@ export function apply(ctx) {
closed = true
if (timer) clearInterval(timer)
if (stop) clearTimeout(stop)
try { scheduleClearOwnedSelectedDefault({ ctx }) } catch { /* 清默认失败不挡停用 */ }
void undeclare()
}
}, 'dsh-purge-redteam: declare agent preset')