v0.29.1 d92a60f

developer_context_test.go RawHistoryFolder

1package provider
2
3import "testing"
4
5func TestSystemWithDeveloperContextSeparatesStableAndDynamicText(t *testing.T) {
6	stable, dynamic, messages := systemWithDeveloperContext(Request{
7		System:        "stable instructions",
8		SystemContext: "legacy host context",
9		Messages: []Message{
10			{Role: RoleDeveloper, Content: []Content{TextBlock{Text: "dynamic host context"}}},
11			{Role: RoleUser, Content: []Content{TextBlock{Text: "user task"}}},
12		},
13	})
14	if stable != "stable instructions" {
15		t.Fatalf("stable = %q", stable)
16	}
17	if dynamic != "legacy host context\n\ndynamic host context" {
18		t.Fatalf("dynamic = %q", dynamic)
19	}
20	if len(messages) != 1 || messages[0].Role != RoleUser {
21		t.Fatalf("messages = %#v, want only the user task", messages)
22	}
23}
24
25func TestAnthropicDeveloperContextFollowsStableCacheBoundary(t *testing.T) {
26	req, err := (&anthropicClient{}).buildRequest(Request{
27		Model:  "claude-sonnet-4-5",
28		System: "stable instructions",
29		Messages: []Message{
30			{Role: RoleDeveloper, Content: []Content{TextBlock{Text: "dynamic host context"}}},
31			{Role: RoleUser, Content: []Content{TextBlock{Text: "user task"}}},
32		},
33	})
34	if err != nil {
35		t.Fatal(err)
36	}
37	if len(req.System) != 2 || req.System[0].Text != "stable instructions" || req.System[0].CacheControl == nil || req.System[1].Text != "dynamic host context" || req.System[1].CacheControl != nil {
38		t.Fatalf("system blocks = %#v", req.System)
39	}
40}
41
42func TestBedrockDeveloperContextFollowsStableCacheBoundary(t *testing.T) {
43	req, err := (&bedrockClient{region: "us-east-1"}).buildRequest(Request{
44		Model:  "anthropic.claude-sonnet-4-5-20250929-v1:0",
45		System: "stable instructions",
46		Messages: []Message{
47			{Role: RoleDeveloper, Content: []Content{TextBlock{Text: "dynamic host context"}}},
48			{Role: RoleUser, Content: []Content{TextBlock{Text: "user task"}}},
49		},
50	})
51	if err != nil {
52		t.Fatal(err)
53	}
54	if len(req.System) != 3 || req.System[0]["text"] != "stable instructions" || req.System[1]["cachePoint"] == nil || req.System[2]["text"] != "dynamic host context" {
55		t.Fatalf("system blocks = %#v", req.System)
56	}
57}

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