(t *testing.T)
| 109 | } |
| 110 | |
| 111 | func TestMaybeChatAskTurn_NativeKnowledgeLoop(t *testing.T) { |
| 112 | t.Setenv(chatAskEnvVar, "true") |
| 113 | t.Setenv(chatKnowledgeEnvVar, "true") |
| 114 | cli := newKnowledgeTestCLI(t) |
| 115 | cli.animation = NewAnimationManager() |
| 116 | cli.animation.SetSuppressed(true) |
| 117 | plugins.SetKnowledgeAdapter(&knowledgePluginAdapter{cli: cli}) |
| 118 | t.Cleanup(func() { plugins.SetKnowledgeAdapter(nil) }) |
| 119 | |
| 120 | fc := &knowledgeToolFake{} |
| 121 | out, handled, err := cli.maybeChatAskTurn(context.Background(), fc, "como instalo?", "", nil, 500, SkillClientResolution{}, func() {}) |
| 122 | if !handled || err != nil { |
| 123 | t.Fatalf("handled=%v err=%v", handled, err) |
| 124 | } |
| 125 | if out != "final grounded answer" { |
| 126 | t.Fatalf("out = %q", out) |
| 127 | } |
| 128 | if fc.calls != 2 { |
| 129 | t.Fatalf("expected decision + follow-up calls, got %d", fc.calls) |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | // knowledgeXMLFake drives the XML transport: first reply asks for a pull, |
| 134 | // second returns prose. |
nothing calls this directly
no test coverage detected