返回 DeepSeek-Reasonix
taskpolicy_route_test.go
根目录 / internal / control / taskpolicy_route_test.go
1 package control
2
3 import (
4 "context"
5 "strings"
6 "testing"
7
8 "reasonix/internal/skill"
9 "reasonix/internal/tool"
10 )
11
12 func TestTurnOrchestratorRoutesCapabilitiesWithFrozenTaskPolicy(t *testing.T) {
13 runner := &plannerMetadataRunner{}
14 reg := tool.NewRegistry()
15 reg.Add(capabilityTestTool{name: "run_skill"})
16 c := newOwnedTestController(t, Options{
17 Runner: runner,
18 Registry: reg,
19 Skills: []skill.Skill{{
20 Name: "security-review",
21 Scope: skill.ScopeBuiltin,
22 Triggers: []string{"authentication"},
23 AutoUse: "suggest",
24 }},
25 })
26
27 const raw = "fix the authentication bypass"
28 if err := newTurnOrchestrator(c).runTurnWithRawDisplay(context.Background(), raw, raw, ""); err != nil {
29 t.Fatal(err)
30 }
31 if !strings.Contains(runner.input, "skill:security-review prefer") && !strings.Contains(runner.input, "security-review") {
32 t.Fatalf("capability route missing security-review:\n%s", runner.input)
33 }
34 }
35
35 lines GO