fix: tighten release review regressions

This commit is contained in:
lpf
2026-03-08 15:48:36 +08:00
parent bb429e3fc8
commit 8d66f6a901
5 changed files with 237 additions and 13 deletions

View File

@@ -673,7 +673,15 @@ func waitSubagentDone(t *testing.T, manager *SubagentManager, timeout time.Durat
tasks := manager.ListTasks()
if len(tasks) > 0 {
task := tasks[0]
if task.Status != "running" {
for _, candidate := range tasks[1:] {
if candidate.Created > task.Created || (candidate.Created == task.Created && candidate.ID > task.ID) {
task = candidate
}
}
manager.mu.RLock()
_, stillRunning := manager.cancelFuncs[task.ID]
manager.mu.RUnlock()
if task.Status != "running" && !stillRunning {
return task
}
}