fix(update): .agents项目自维护文件改判可选更新,防止升级强制覆盖与强制删除

This commit is contained in:
augushong
2026-09-07 23:46:22 +08:00
parent e53fadbad8
commit 68823568ef
2 changed files with 89 additions and 0 deletions

View File

@@ -664,6 +664,14 @@ class AdminUpdateServiceBase
protected function testIsOptionalFiles($file_path)
{
// .agents 下项目自维护的文件:可选更新,防止被强制覆盖/强制删除
if ($file_path === '.agents/PROJECT.md') {
return true;
}
if (str_starts_with($file_path, '.agents/rules/project-')) {
return true;
}
// 如果file_path以app或config开头,则是可选更新的文件
$optional_files_prefix = [
'app',