TestRetrieveWorkspaceContext_NoHyDE exercises the refactored chat retrieval call site: with HyDE off, hydeAugmenterFor returns nil and the workspace context is still assembled normally through BuildWorkspaceContextMode.
(t *testing.T)
| 158 | // call site: with HyDE off, hydeAugmenterFor returns nil and the workspace |
| 159 | // context is still assembled normally through BuildWorkspaceContextMode. |
| 160 | func TestRetrieveWorkspaceContext_NoHyDE(t *testing.T) { |
| 161 | resetHydeProvider(t) |
| 162 | t.Setenv("CHATCLI_EMBED_PROVIDER", "") // no augmenter even if HyDE is on |
| 163 | |
| 164 | wsDir := t.TempDir() |
| 165 | if err := os.WriteFile(filepath.Join(wsDir, "SOUL.md"), []byte("You are a helpful assistant"), 0o644); err != nil { |
| 166 | t.Fatal(err) |
| 167 | } |
| 168 | bl := workspace.NewBootstrapLoader(wsDir, t.TempDir(), zap.NewNop()) |
| 169 | ms := workspace.NewMemoryStore(t.TempDir(), zap.NewNop()) |
| 170 | cli := &ChatCLI{logger: zap.NewNop(), contextBuilder: workspace.NewContextBuilder(bl, ms, t.TempDir())} |
| 171 | |
| 172 | out := cli.retrieveWorkspaceContext(context.Background(), "hello", nil) |
| 173 | if !strings.Contains(out, "You are a helpful assistant") { |
| 174 | t.Fatalf("expected workspace context to include bootstrap content, got %q", out) |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | func TestEmbeddingProviderLabel(t *testing.T) { |
| 179 | if got := embeddingProviderLabel(nil); got != "null" { |
nothing calls this directly
no test coverage detected