@@ -13,6 +13,7 @@ import (
13 "charm.land/fantasy/providers/openai"
13 "charm.land/fantasy/providers/openai"
14 "charm.land/fantasy/providers/openaicompat"
14 "charm.land/fantasy/providers/openaicompat"
15 "charm.land/fantasy/providers/openrouter"
15 "charm.land/fantasy/providers/openrouter"
16 "github.com/charmbracelet/catwalk/pkg/catwalk"
17 "github.com/charmbracelet/catwalk/pkg/catwalk"
17 "github.com/charmbracelet/crush/internal/agent/prompt"
18 "github.com/charmbracelet/crush/internal/agent/prompt"
18 "github.com/charmbracelet/crush/internal/agent/tools"
19 "github.com/charmbracelet/crush/internal/agent/tools"
@@ -25,7 +26,6 @@ import (
25 "github.com/charmbracelet/crush/internal/permission"
26 "github.com/charmbracelet/crush/internal/permission"
26 "github.com/charmbracelet/crush/internal/session"
27 "github.com/charmbracelet/crush/internal/session"
27 "github.com/stretchr/testify/require"
28 "github.com/stretchr/testify/require"
28− "gopkg.in/dnaeon/go-vcr.v4/pkg/recorder"
30 _ "github.com/joho/godotenv/autoload"
30 _ "github.com/joho/godotenv/autoload"
@@ -40,7 +40,7 @@ type fakeEnv struct {
40 lspClients *csync.Map[string, *lsp.Client]
40 lspClients *csync.Map[string, *lsp.Client]
43−type builderFunc func(t *testing.T, r *recorder.Recorder) (fantasy.LanguageModel, error)
43+type builderFunc func(t *testing.T, r *vcr.Recorder) (fantasy.LanguageModel, error)
45type modelPair struct {
45type modelPair struct {
46 name string
46 name string
@@ -49,7 +49,7 @@ type modelPair struct {
51func anthropicBuilder(model string) builderFunc {
51func anthropicBuilder(model string) builderFunc {
52− return func(t *testing.T, r *recorder.Recorder) (fantasy.LanguageModel, error) {
52+ return func(t *testing.T, r *vcr.Recorder) (fantasy.LanguageModel, error) {
53 provider, err := anthropic.New(
53 provider, err := anthropic.New(
54 anthropic.WithAPIKey(os.Getenv("CRUSH_ANTHROPIC_API_KEY")),
54 anthropic.WithAPIKey(os.Getenv("CRUSH_ANTHROPIC_API_KEY")),
55 anthropic.WithHTTPClient(&http.Client{Transport: r}),
55 anthropic.WithHTTPClient(&http.Client{Transport: r}),
@@ -62,7 +62,7 @@ func anthropicBuilder(model string) builderFunc {
64func openaiBuilder(model string) builderFunc {
64func openaiBuilder(model string) builderFunc {
65− return func(t *testing.T, r *recorder.Recorder) (fantasy.LanguageModel, error) {
65+ return func(t *testing.T, r *vcr.Recorder) (fantasy.LanguageModel, error) {
66 provider, err := openai.New(
66 provider, err := openai.New(
67 openai.WithAPIKey(os.Getenv("CRUSH_OPENAI_API_KEY")),
67 openai.WithAPIKey(os.Getenv("CRUSH_OPENAI_API_KEY")),
68 openai.WithHTTPClient(&http.Client{Transport: r}),
68 openai.WithHTTPClient(&http.Client{Transport: r}),
@@ -75,7 +75,7 @@ func openaiBuilder(model string) builderFunc {
77func openRouterBuilder(model string) builderFunc {
77func openRouterBuilder(model string) builderFunc {
78− return func(t *testing.T, r *recorder.Recorder) (fantasy.LanguageModel, error) {
78+ return func(t *testing.T, r *vcr.Recorder) (fantasy.LanguageModel, error) {
79 provider, err := openrouter.New(
79 provider, err := openrouter.New(
80 openrouter.WithAPIKey(os.Getenv("CRUSH_OPENROUTER_API_KEY")),
80 openrouter.WithAPIKey(os.Getenv("CRUSH_OPENROUTER_API_KEY")),
81 openrouter.WithHTTPClient(&http.Client{Transport: r}),
81 openrouter.WithHTTPClient(&http.Client{Transport: r}),
@@ -88,7 +88,7 @@ func openRouterBuilder(model string) builderFunc {
90func zAIBuilder(model string) builderFunc {
90func zAIBuilder(model string) builderFunc {
91− return func(t *testing.T, r *recorder.Recorder) (fantasy.LanguageModel, error) {
91+ return func(t *testing.T, r *vcr.Recorder) (fantasy.LanguageModel, error) {
92 provider, err := openaicompat.New(
92 provider, err := openaicompat.New(
93 openaicompat.WithBaseURL("https://api.z.ai/api/coding/paas/v4"),
93 openaicompat.WithBaseURL("https://api.z.ai/api/coding/paas/v4"),
94 openaicompat.WithAPIKey(os.Getenv("CRUSH_ZAI_API_KEY")),
94 openaicompat.WithAPIKey(os.Getenv("CRUSH_ZAI_API_KEY")),
@@ -153,7 +153,7 @@ func testSessionAgent(env fakeEnv, large, small fantasy.LanguageModel, systemPro
153 return agent
153 return agent
156−func coderAgent(r *recorder.Recorder, env fakeEnv, large, small fantasy.LanguageModel) (SessionAgent, error) {
156+func coderAgent(r *vcr.Recorder, env fakeEnv, large, small fantasy.LanguageModel) (SessionAgent, error) {
157 fixedTime := func() time.Time {
157 fixedTime := func() time.Time {
158 t, _ := time.Parse("1/2/2006", "1/1/2025")
158 t, _ := time.Parse("1/2/2006", "1/1/2025")