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>
29 lines
999 B
Go
29 lines
999 B
Go
package runmgr
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"agent-system-backend/internal/runtime"
|
|
core "agent-system-core"
|
|
)
|
|
|
|
type nameRunner struct{ name string }
|
|
|
|
func (n nameRunner) Name() string { return n.name }
|
|
func (n nameRunner) Execute(rc runtime.RunCtx) error { return nil }
|
|
|
|
func TestSelectConversationRunner(t *testing.T) {
|
|
m := &Manager{runner: nameRunner{name: "direct"}, mock: nameRunner{name: "mock"}, squad: nameRunner{name: "squad"}}
|
|
if got := selectConversationRunner(m, core.EffectiveSettings{}); got.Name() != "direct" {
|
|
t.Fatalf("default = %s", got.Name())
|
|
}
|
|
squadEff := core.EffectiveSettings{"runtime": map[string]any{"entry": "squad"}}
|
|
if got := selectConversationRunner(m, squadEff); got.Name() != "squad" {
|
|
t.Fatalf("squad entry = %s", got.Name())
|
|
}
|
|
mockEff := core.EffectiveSettings{"runtime": map[string]any{"entry": "squad", "mock": true}}
|
|
if got := selectConversationRunner(m, mockEff); got.Name() != "mock" {
|
|
t.Fatalf("mock wins = %s", got.Name())
|
|
}
|
|
}
|