MCPcopy Create free account
hub / github.com/diillson/chatcli / TestRetrieveWorkspaceContext_NoHyDE

Function TestRetrieveWorkspaceContext_NoHyDE

cli/hyde_setup_test.go:160–176  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

158// call site: with HyDE off, hydeAugmenterFor returns nil and the workspace
159// context is still assembled normally through BuildWorkspaceContextMode.
160func 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
178func TestEmbeddingProviderLabel(t *testing.T) {
179 if got := embeddingProviderLabel(nil); got != "null" {

Callers

nothing calls this directly

Calls 5

NewBootstrapLoaderFunction · 0.92
NewMemoryStoreFunction · 0.92
NewContextBuilderFunction · 0.92
resetHydeProviderFunction · 0.85

Tested by

no test coverage detected