Why: Squad steps previously ran without tools, and the product had no way to make the squad the conversation entry without losing streaming, cards, or the deliverable guard. Evidence: go test ./... -count=1 passed, including streaming, cardflow, false-deliverable rejection, tool allowlist, model routing, usage, cancel, and turn and tool budgets. Impact: runtime.entry defaults to direct. squad uses one kernel step for simple work and the leader for the rest. squad_orchestrate is hidden in that mode. The default is not switched. Refs: deliverable-quality-system B3-B5 Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
782 B
Go
28 lines
782 B
Go
package eval
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestSwitchStaysDirectWithoutScores(t *testing.T) {
|
|
dec := DecideSwitch(nil, nil)
|
|
if dec.Met || !strings.Contains(Report(dec), "保持 direct") {
|
|
t.Fatalf("%+v %s", dec, Report(dec))
|
|
}
|
|
}
|
|
|
|
func TestSwitchRequiresScoreAndLatency(t *testing.T) {
|
|
direct := &EntryScore{Name: "direct", Score: 80, FirstTokenP50: time.Second}
|
|
slow := &EntryScore{Name: "squad", Score: 90, FirstTokenP50: 5 * time.Second}
|
|
if DecideSwitch(direct, slow).Met {
|
|
t.Fatal("extra latency above 3s must block the switch")
|
|
}
|
|
ok := &EntryScore{Name: "squad", Score: 80, FirstTokenP50: 3 * time.Second}
|
|
dec := DecideSwitch(direct, ok)
|
|
if !dec.Met || !strings.Contains(Report(dec), "改为 squad") {
|
|
t.Fatalf("%+v %s", dec, Report(dec))
|
|
}
|
|
}
|