@@ -13,6 +13,7 @@ import (
1313 "charm.land/fantasy/providers/openai"
1414 "charm.land/fantasy/providers/openaicompat"
1515 "charm.land/fantasy/providers/openrouter"
16+ "charm.land/x/vcr"
1617 "github.com/charmbracelet/catwalk/pkg/catwalk"
1718 "github.com/charmbracelet/crush/internal/agent/prompt"
1819 "github.com/charmbracelet/crush/internal/agent/tools"
@@ -25,7 +26,6 @@ import (
2526 "github.com/charmbracelet/crush/internal/permission"
2627 "github.com/charmbracelet/crush/internal/session"
2728 "github.com/stretchr/testify/require"
28− "gopkg.in/dnaeon/go-vcr.v4/pkg/recorder"
2929
3030 _ "github.com/joho/godotenv/autoload"
3131)
@@ -40,7 +40,7 @@ type fakeEnv struct {
4040 lspClients *csync.Map[string, *lsp.Client]
4141}
4242
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)
4444
4545type modelPair struct {
4646 name string
@@ -49,7 +49,7 @@ type modelPair struct {
4949}
5050
5151func 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) {
5353 provider, err := anthropic.New(
5454 anthropic.WithAPIKey(os.Getenv("CRUSH_ANTHROPIC_API_KEY")),
5555 anthropic.WithHTTPClient(&http.Client{Transport: r}),
@@ -62,7 +62,7 @@ func anthropicBuilder(model string) builderFunc {
6262}
6363
6464func 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) {
6666 provider, err := openai.New(
6767 openai.WithAPIKey(os.Getenv("CRUSH_OPENAI_API_KEY")),
6868 openai.WithHTTPClient(&http.Client{Transport: r}),
@@ -75,7 +75,7 @@ func openaiBuilder(model string) builderFunc {
7575}
7676
7777func 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) {
7979 provider, err := openrouter.New(
8080 openrouter.WithAPIKey(os.Getenv("CRUSH_OPENROUTER_API_KEY")),
8181 openrouter.WithHTTPClient(&http.Client{Transport: r}),
@@ -88,7 +88,7 @@ func openRouterBuilder(model string) builderFunc {
8888}
8989
9090func 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) {
9292 provider, err := openaicompat.New(
9393 openaicompat.WithBaseURL("https://api.z.ai/api/coding/paas/v4"),
9494 openaicompat.WithAPIKey(os.Getenv("CRUSH_ZAI_API_KEY")),
@@ -153,7 +153,7 @@ func testSessionAgent(env fakeEnv, large, small fantasy.LanguageModel, systemPro
153153 return agent
154154}
155155
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) {
157157 fixedTime := func() time.Time {
158158 t, _ := time.Parse("1/2/2006", "1/1/2025")
159159 return t