v0.3.97 c2267b3

systemprompt_test.go RawHistoryFolder

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 TestBuildSystemPromptPlatform(t *testing.T) {
34	for _, tc := range []struct {
35		goos      string
36		wantHint  bool
37		wantLabel string
38	}{
39		{"windows", true, "Platform: windows/amd64"},
40		{"linux", false, "Platform: linux/amd64"},
41		{"darwin", false, "Platform: darwin/amd64"},
42	} {
43		got := BuildSystemPrompt(SystemPromptOpts{CWD: "/w", GOOS: tc.goos, GOARCH: "amd64"})
44		if !strings.Contains(got, tc.wantLabel) {
45			t.Errorf("%s: missing %q:\n%s", tc.goos, tc.wantLabel, got)
46		}
47		if strings.Contains(got, "cmd.exe /C") != tc.wantHint {
48			t.Errorf("%s: windows shell hint present=%v, want %v", tc.goos, !tc.wantHint, tc.wantHint)
49		}
50	}
51}
52
53func TestBuildSystemPromptDefaultIncludesBuiltInDocs(t *testing.T) {
54	got := BuildSystemPrompt(SystemPromptOpts{
55		CWD:        "/workspace",
56		Now:        time.Date(2026, time.August, 6, 0, 0, 0, 0, time.UTC),
57		ZotDocsDir: "/zot/docs",
58	})
59
60	if !strings.Contains(got, "Zot's own docs are installed under /zot/docs") {
61		t.Fatalf("default prompt missing built-in docs guidance:\n%s", got)
62	}
63}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close