1package agent
2
3import (
4 "strings"
5 "testing"
6 "time"
7)
8
9func TestBuildSystemPromptCustomOmitsBuiltInDocs(t *testing.T) {
10 got := BuildSystemPrompt(SystemPromptOpts{
11 CWD: "/workspace",
12 Custom: "Custom instructions",
13 Append: []string{"Additional context"},
14 Now: time.Date(2026, time.August, 6, 0, 0, 0, 0, time.UTC),
15 ZotDocsDir: "/zot/docs",
16 })
17
18 if strings.Contains(got, "Zot's own docs") || strings.Contains(got, "/zot/docs") {
19 t.Fatalf("custom prompt includes built-in docs guidance:\n%s", got)
20 }
21 for _, want := range []string{
22 "Custom instructions",
23 "Additional context",
24 "Current date: 2026-08-06",
25 "Current working directory: /workspace",
26 } {
27 if !strings.Contains(got, want) {
28 t.Errorf("custom prompt missing %q:\n%s", want, got)
29 }
30 }
31}
32
33func TestBuildSystemPromptDefaultIncludesBuiltInDocs(t *testing.T) {
34 got := BuildSystemPrompt(SystemPromptOpts{
35 CWD: "/workspace",
36 Now: time.Date(2026, time.August, 6, 0, 0, 0, 0, time.UTC),
37 ZotDocsDir: "/zot/docs",
38 })
39
40 if !strings.Contains(got, "Zot's own docs are installed under /zot/docs") {
41 t.Fatalf("default prompt missing built-in docs guidance:\n%s", got)
42 }
43}