fix: 按评审补齐 mock 校验、Worker 上限保护与测试(Codex gpt-6-sol)

This commit is contained in:
RuoJi6 committed 2026-10-24 22:08:35 +08:00
1 parent a1dc362bae
commit 2e6ceddf95
8 files changed
+125 -21

No files matched your search

+5
View File
@@ -778,6 +778,11 @@ func (e *Engine) Run(ctx context.Context, t *Task) {
func workerCountForTask(t *Task, global int) int {
if t != nil && t.WorkerCount > 0 {
// Direct database edits can bypass validation; cap those values so the
// engine never starts more than the supported per-task worker count.
if t.WorkerCount > db.MaxTaskWorkerCount {
return db.MaxTaskWorkerCount
}
return t.WorkerCount
}
return global