Add read-only task context inheritance, ordered task-level LLM failover, live Worker controls, cascading task cleanup, FIFO task concurrency, cancellation diagnostics, UI updates, tests, build script, and changelog.
21 lines
636 B
Go
21 lines
636 B
Go
package db
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestCreateTaskRejectsTooManySourcesBeforeOpeningTransaction(t *testing.T) {
|
|
sourceIDs := make([]int64, MaxTaskSourceCount+1)
|
|
for i := range sourceIDs {
|
|
sourceIDs[i] = int64(i + 1)
|
|
}
|
|
|
|
// No database handle is needed: validation must run before Begin so an
|
|
// oversized request cannot consume a connection or create partial rows.
|
|
_, err := (&DB{}).CreateTaskWithOptions("child", "goal", TaskCreateOptions{SourceTaskIDs: sourceIDs})
|
|
if err == nil || !strings.Contains(err.Error(), "too many source tasks") {
|
|
t.Fatalf("expected source-count validation error, got %v", err)
|
|
}
|
|
}
|