v0.4.11 e5c9e04

sonnet55_test.go RawHistoryFolder

1package provider
2
3import (
4	"slices"
5	"testing"
6)
7
8func TestSonnet55CatalogAndThinking(t *testing.T) {
9	for _, tc := range []struct {
10		name   string
11		client *anthropicClient
12	}{
13		{"api-key", NewAnthropic("synthetic-key", "").(*anthropicClient)},
14		{"oauth", NewAnthropicOAuth("synthetic-token", "").(*anthropicClient)},
15	} {
16		t.Run(tc.name, func(t *testing.T) {
17			const id = "claude-sonnet-5-5"
18			m, err := FindModel("anthropic", id)
19			if err != nil {
20				t.Fatal(err)
21			}
22			if m.ContextWindow != 1000000 || m.MaxOutput != 128000 || !m.Reasoning || !m.AdaptiveThinking || m.Speculative {
23				t.Fatalf("unexpected capabilities: %+v", m)
24			}
25			if m.PriceInput != 2 || m.PriceOutput != 10 || m.PriceCacheRead != 0.2 || m.PriceCacheWrite != 2.5 {
26				t.Fatalf("unexpected pricing: %+v", m)
27			}
28			want := []string{"low", "medium", "high", "xhigh", "max"}
29			if got := AvailableReasoningLevels(m); !slices.Equal(got, want) {
30				t.Fatalf("levels = %q, want %q", got, want)
31			}
32			for _, level := range []string{"", "off", "minimum", "low", "medium", "high", "xhigh", "max"} {
33				effort := level
34				if level == "" || level == "off" || level == "minimum" {
35					effort = "low"
36				}
37				if got := ClampReasoningForModel(m, level); got != effort {
38					t.Errorf("clamp(%q) = %q, want %q", level, got, effort)
39				}
40				temperature := float32(0.5)
41				wire, err := tc.client.buildRequest(Request{Model: id, Reasoning: level, Temperature: &temperature})
42				if err != nil {
43					t.Fatal(err)
44				}
45				if wire.Model != id || wire.MaxTokens != 128000 || wire.Temperature != nil {
46					t.Fatalf("unexpected request: %+v", wire)
47				}
48				if wire.Thinking == nil || wire.Thinking.Type != "adaptive" || wire.Thinking.BudgetTokens != 0 {
49					t.Fatalf("thinking = %+v", wire.Thinking)
50				}
51				if wire.OutputConfig == nil || wire.OutputConfig.Effort != effort {
52					t.Fatalf("output config = %+v, want effort %q", wire.OutputConfig, effort)
53				}
54			}
55		})
56	}
57}
58
59func TestSonnet55ReasoningOverrides(t *testing.T) {
60	m, err := FindModel("anthropic", "claude-sonnet-5-5")
61	if err != nil {
62		t.Fatal(err)
63	}
64	m.ReasoningLevelMap = map[string]string{"max": "xhigh"}
65	want := []string{"low", "medium", "high", "xhigh"}
66	if got := AvailableReasoningLevels(m); !slices.Equal(got, want) {
67		t.Fatalf("levels = %q, want %q", got, want)
68	}
69	if got := ClampReasoningForModel(m, "off"); got != "low" {
70		t.Fatalf("off clamped to %q, want low", got)
71	}
72}

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