Merge branch 'main' into ui

Ayman Bagabas created

Change summary

.gitattributes                                                                            |   1 
.github/cla-signatures.json                                                               |  16 
.gitignore                                                                                |   1 
go.mod                                                                                    |  28 
go.sum                                                                                    |  12 
internal/agent/agent_test.go                                                              |   7 
internal/agent/coordinator.go                                                             |  16 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/bash_tool.yaml                    |  33 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/download_tool.yaml                |  25 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/fetch_tool.yaml                   |  29 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/glob_tool.yaml                    |  25 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/grep_tool.yaml                    |  22 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/ls_tool.yaml                      |  30 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/multiedit_tool.yaml               |  23 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/parallel_tool_calls.yaml          |  28 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/read_a_file.yaml                  |  20 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/simple_test.yaml                  |  20 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/sourcegraph_tool.yaml             |  21 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/update_a_file.yaml                |  22 
internal/agent/testdata/TestCoderAgent/anthropic-sonnet/write_tool.yaml                   |  28 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/bash_tool.yaml                        |  28 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/download_tool.yaml                    |  24 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/fetch_tool.yaml                       |  30 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/glob_tool.yaml                        |  28 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/grep_tool.yaml                        |  32 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/ls_tool.yaml                          |  24 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/multiedit_tool.yaml                   |  40 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/parallel_tool_calls.yaml              |  30 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/read_a_file.yaml                      |  20 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/simple_test.yaml                      |  14 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/sourcegraph_tool.yaml                 |  34 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/update_a_file.yaml                    |  30 
internal/agent/testdata/TestCoderAgent/openai-gpt-5/write_tool.yaml                       |  24 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/bash_tool.yaml                  |  30 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/download_tool.yaml              |  30 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/fetch_tool.yaml                 |  24 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/glob_tool.yaml                  |  30 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/grep_tool.yaml                  |  26 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/ls_tool.yaml                    |  24 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/multiedit_tool.yaml             |  20 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls.yaml        |  28 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/read_a_file.yaml                |   3 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/simple_test.yaml                |  14 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool.yaml           |  30 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/update_a_file.yaml              |  26 
internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/write_tool.yaml                 |  24 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/bash_tool.yaml                          |  24 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/download_tool.yaml                      |  20 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/fetch_tool.yaml                         |  22 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/glob_tool.yaml                          |  20 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/grep_tool.yaml                          |  16 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/ls_tool.yaml                            |  18 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/multiedit_tool.yaml                     |  24 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/parallel_tool_calls.yaml                |   3 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/read_a_file.yaml                        |  14 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/simple_test.yaml                        |  12 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/sourcegraph_tool.yaml                   |  20 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/update_a_file.yaml                      |  22 
internal/agent/testdata/TestCoderAgent/zai-glm4.6/write_tool.yaml                         |  20 
internal/agent/tools/download.go                                                          |   5 
internal/agent/tools/multiedit.go                                                         |  76 
internal/agent/tools/multiedit.md                                                         |  35 
internal/agent/tools/multiedit_test.go                                                    | 225 
internal/cmd/root.go                                                                      |  20 
internal/config/config.go                                                                 |   2 
internal/shell/coreutils.go                                                               |  19 
internal/shell/shell.go                                                                   |  21 
internal/tui/components/chat/messages/renderer.go                                         |  11 
internal/tui/components/dialogs/permissions/permissions.go                                |  13 
internal/tui/components/logo/logo.go                                                      |   5 
internal/tui/components/logo/rand.go                                                      |  24 
internal/tui/exp/diffview/diffview.go                                                     |  29 
internal/tui/exp/diffview/diffview_test.go                                                |   6 
internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf016.golden            |   0 
internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf017.golden            |   0 
internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf018.golden            |   0 
internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf019.golden            |   0 
internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf020.golden            |   0 
internal/tui/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf017.golden          |   3 
internal/tui/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf018.golden          |   4 
internal/tui/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf019.golden          |   5 
internal/tui/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf020.golden          |   6 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf11.golden   |   0 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf12.golden   |   0 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf13.golden   |   5 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf14.golden   |   6 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf15.golden   |   5 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf16.golden   |   5 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf12.golden |   3 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf13.golden |   4 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf14.golden |   5 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf15.golden |   6 
internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf16.golden |   5 
internal/tui/tui.go                                                                       |  30 
internal/ui/model/ui.go                                                                   |  31 
95 files changed, 1,145 insertions(+), 778 deletions(-)

Detailed changes

.gitattributes 🔗

@@ -1,2 +1,3 @@
 *.golden linguist-generated=true -text
 .github/crush-schema.json linguist-generated=true
+internal/agent/testdata/**/*.yaml -diff linguist-generated=true

.github/cla-signatures.json 🔗

@@ -775,6 +775,22 @@
       "created_at": "2025-10-28T12:24:21Z",
       "repoId": 987670088,
       "pullRequestNo": 1312
+    },
+    {
+      "name": "bradflaugher",
+      "id": 16511019,
+      "comment_id": 3458922489,
+      "created_at": "2025-10-28T23:13:15Z",
+      "repoId": 987670088,
+      "pullRequestNo": 1324
+    },
+    {
+      "name": "teras",
+      "id": 592568,
+      "comment_id": 3465825058,
+      "created_at": "2025-10-30T02:04:26Z",
+      "repoId": 987670088,
+      "pullRequestNo": 1335
     }
   ]
 }

.gitignore 🔗

@@ -45,6 +45,7 @@ Thumbs.db
 **/.crush/**
 
 /crush
+/tmp/
 
 manpages/
 completions/

go.mod 🔗

@@ -3,7 +3,7 @@ module github.com/charmbracelet/crush
 go 1.25.0
 
 require (
-	charm.land/fantasy v0.1.3
+	charm.land/fantasy v0.1.4
 	github.com/JohannesKaufmann/html-to-markdown v1.6.0
 	github.com/MakeNowJust/heredoc v1.0.0
 	github.com/PuerkitoBio/goquery v1.10.3
@@ -13,29 +13,37 @@ require (
 	github.com/bmatcuk/doublestar/v4 v4.9.1
 	github.com/charlievieth/fastwalk v1.0.14
 	github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250820203609-601216f68ee2
-	github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.5
-	github.com/charmbracelet/catwalk v0.7.1-0.20251026125030-34dd898c1f9a
+	github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.6
+	github.com/charmbracelet/catwalk v0.8.1
+	github.com/charmbracelet/colorprofile v0.3.2
 	github.com/charmbracelet/fang v0.4.3
 	github.com/charmbracelet/glamour/v2 v2.0.0-20250811143442-a27abb32f018
 	github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.3.0.20250917201909-41ff0bf215ea
 	github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706
+	github.com/charmbracelet/ultraviolet v0.0.0-20251017140847-d4ace4d6e731
 	github.com/charmbracelet/x/ansi v0.10.2
 	github.com/charmbracelet/x/exp/charmtone v0.0.0-20250708181618-a60a724ba6c3
 	github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a
 	github.com/charmbracelet/x/exp/ordered v0.1.0
+	github.com/charmbracelet/x/exp/slice v0.0.0-20250904123553-b4e2667e5ad5
 	github.com/charmbracelet/x/powernap v0.0.0-20251015113943-25f979b54ad4
 	github.com/charmbracelet/x/term v0.2.1
+	github.com/denisbrodbeck/machineid v1.0.1
 	github.com/disintegration/imageorient v0.0.0-20180920195336-8147d86e83ec
 	github.com/google/uuid v1.6.0
 	github.com/invopop/jsonschema v0.13.0
 	github.com/joho/godotenv v1.5.1
+	github.com/lucasb-eyer/go-colorful v1.3.0
 	github.com/modelcontextprotocol/go-sdk v1.0.0
 	github.com/muesli/termenv v0.16.0
 	github.com/ncruces/go-sqlite3 v0.29.1
 	github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
 	github.com/nxadm/tail v1.4.11
+	github.com/openai/openai-go/v2 v2.7.1
+	github.com/posthog/posthog-go v1.6.12
 	github.com/pressly/goose/v3 v3.25.0
 	github.com/qjebbs/go-jsons v1.0.0-alpha.4
+	github.com/rivo/uniseg v0.4.7
 	github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
 	github.com/sahilm/fuzzy v0.1.1
 	github.com/spf13/cobra v1.10.1
@@ -45,8 +53,11 @@ require (
 	github.com/tidwall/sjson v1.2.5
 	github.com/zeebo/xxh3 v1.0.2
 	go.yaml.in/yaml/v4 v4.0.0-rc.2
+	golang.org/x/sync v0.17.0
+	golang.org/x/text v0.30.0
 	gopkg.in/dnaeon/go-vcr.v4 v4.0.6-0.20250923044825-7b4892dd3117
 	gopkg.in/natefinch/lumberjack.v2 v2.2.1
+	mvdan.cc/sh/moreinterp v0.0.0-20250902163504-3cf4fd5717a5
 	mvdan.cc/sh/v3 v3.12.1-0.20250902163504-3cf4fd5717a5
 )
 
@@ -77,16 +88,12 @@ require (
 	github.com/bahlo/generic-list-go v0.2.0 // indirect
 	github.com/buger/jsonparser v1.1.1 // indirect
 	github.com/charmbracelet/anthropic-sdk-go v0.0.0-20251024181547-21d6f3d9a904 // indirect
-	github.com/charmbracelet/colorprofile v0.3.2
 	github.com/charmbracelet/go-genai v0.0.0-20251021165952-9befde14ce97 // indirect
-	github.com/charmbracelet/ultraviolet v0.0.0-20251017140847-d4ace4d6e731
 	github.com/charmbracelet/x/cellbuf v0.0.14-0.20250811133356-e0c5dbe5ea4a // indirect
-	github.com/charmbracelet/x/exp/slice v0.0.0-20250904123553-b4e2667e5ad5
 	github.com/charmbracelet/x/json v0.2.0 // indirect
 	github.com/charmbracelet/x/termios v0.1.1 // indirect
 	github.com/charmbracelet/x/windows v0.2.2 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
-	github.com/denisbrodbeck/machineid v1.0.1
 	github.com/disintegration/gift v1.1.2 // indirect
 	github.com/dlclark/regexp2 v1.11.5 // indirect
 	github.com/dustin/go-humanize v1.0.1 // indirect
@@ -108,7 +115,6 @@ require (
 	github.com/klauspost/compress v1.18.0 // indirect
 	github.com/klauspost/cpuid/v2 v2.0.9 // indirect
 	github.com/klauspost/pgzip v1.2.6 // indirect
-	github.com/lucasb-eyer/go-colorful v1.3.0
 	github.com/mailru/easyjson v0.7.7 // indirect
 	github.com/mattn/go-isatty v0.0.20 // indirect
 	github.com/mattn/go-runewidth v0.0.17 // indirect
@@ -121,11 +127,8 @@ require (
 	github.com/muesli/mango-pflag v0.1.0 // indirect
 	github.com/muesli/roff v0.1.0 // indirect
 	github.com/ncruces/julianday v1.0.0 // indirect
-	github.com/openai/openai-go/v2 v2.7.1
 	github.com/pierrec/lz4/v4 v4.1.22 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
-	github.com/posthog/posthog-go v1.6.12
-	github.com/rivo/uniseg v0.4.7
 	github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
 	github.com/sethvargo/go-retry v0.3.0 // indirect
 	github.com/sourcegraph/jsonrpc2 v0.2.1 // indirect
@@ -153,10 +156,8 @@ require (
 	golang.org/x/image v0.27.0 // indirect
 	golang.org/x/net v0.44.0 // indirect
 	golang.org/x/oauth2 v0.32.0 // indirect
-	golang.org/x/sync v0.17.0 // indirect
 	golang.org/x/sys v0.37.0 // indirect
 	golang.org/x/term v0.35.0 // indirect
-	golang.org/x/text v0.30.0
 	golang.org/x/time v0.12.0 // indirect
 	google.golang.org/api v0.239.0 // indirect
 	google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
@@ -164,5 +165,4 @@ require (
 	google.golang.org/protobuf v1.36.10 // indirect
 	gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
-	mvdan.cc/sh/moreinterp v0.0.0-20250902163504-3cf4fd5717a5
 )

go.sum 🔗

@@ -1,5 +1,5 @@
-charm.land/fantasy v0.1.3 h1:MFQPlmP9h/JAvSI1Yq7A0jAyMEl0t1rXNv3DYNmCM8Q=
-charm.land/fantasy v0.1.3/go.mod h1:GT1Y8uYNmmu7OkUxWEiOyzdAf1jYopPJfpWvoDRzGiM=
+charm.land/fantasy v0.1.4 h1:H/l2GfMy6Pon0GcXoj4/kuHKZ0jm//xDe2Got0eF3AU=
+charm.land/fantasy v0.1.4/go.mod h1:GT1Y8uYNmmu7OkUxWEiOyzdAf1jYopPJfpWvoDRzGiM=
 cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE=
 cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U=
 cloud.google.com/go/auth v0.17.0 h1:74yCm7hCj2rUyyAocqnFzsAYXgJhrG26XCFimrc/Kz4=
@@ -80,10 +80,10 @@ github.com/charmbracelet/anthropic-sdk-go v0.0.0-20251024181547-21d6f3d9a904 h1:
 github.com/charmbracelet/anthropic-sdk-go v0.0.0-20251024181547-21d6f3d9a904/go.mod h1:8TIYxZxsuCqqeJ0lga/b91tBwrbjoHDC66Sq5t8N2R4=
 github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250820203609-601216f68ee2 h1:973OHYuq2Jx9deyuPwe/6lsuQrDCatOsjP8uCd02URE=
 github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250820203609-601216f68ee2/go.mod h1:6HamsBKWqEC/FVHuQMHgQL+knPyvHH55HwJDHl/adMw=
-github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.5 h1:oAChAeh730gtLKK/BpaTeJHzmj3KFuEfQ7AZgf2VGHM=
-github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.5/go.mod h1:SUTLq+/pGQ5qntHgt0JswfVJFfgJgWDqyvyiSLVlmbo=
-github.com/charmbracelet/catwalk v0.7.1-0.20251026125030-34dd898c1f9a h1:O3NMgyqjDzxZhsp1ODDdo6VXQJ0fxq2tH1WCxuU0ymk=
-github.com/charmbracelet/catwalk v0.7.1-0.20251026125030-34dd898c1f9a/go.mod h1:ReU4SdrLfe63jkEjWMdX2wlZMV3k9r11oQAmzN0m+KY=
+github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.6 h1:nXNg4TmtfoQXFdF2BSSjTxFp9bSHQCILkIKK3FXMW/E=
+github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.6/go.mod h1:SUTLq+/pGQ5qntHgt0JswfVJFfgJgWDqyvyiSLVlmbo=
+github.com/charmbracelet/catwalk v0.8.1 h1:Okn6EgMSHlNCYQrSQkyAjLuLiSzDmReGLc0MPcG2F9g=
+github.com/charmbracelet/catwalk v0.8.1/go.mod h1:ReU4SdrLfe63jkEjWMdX2wlZMV3k9r11oQAmzN0m+KY=
 github.com/charmbracelet/colorprofile v0.3.2 h1:9J27WdztfJQVAQKX2WOlSSRB+5gaKqqITmrvb1uTIiI=
 github.com/charmbracelet/colorprofile v0.3.2/go.mod h1:mTD5XzNeWHj8oqHb+S1bssQb7vIHbepiebQ2kPKVKbI=
 github.com/charmbracelet/fang v0.4.3 h1:qXeMxnL4H6mSKBUhDefHu8NfikFbP/MBNTfqTrXvzmY=

internal/agent/agent_test.go 🔗

@@ -3,6 +3,7 @@ package agent
 import (
 	"os"
 	"path/filepath"
+	"runtime"
 	"strings"
 	"testing"
 
@@ -45,6 +46,10 @@ func setupAgent(t *testing.T, pair modelPair) (SessionAgent, env) {
 }
 
 func TestCoderAgent(t *testing.T) {
+	if runtime.GOOS == "windows" {
+		t.Skip("skipping on windows for now")
+	}
+
 	for _, pair := range modelPairs {
 		t.Run(pair.name, func(t *testing.T) {
 			t.Run("simple test", func(t *testing.T) {
@@ -165,7 +170,7 @@ func TestCoderAgent(t *testing.T) {
 				require.NoError(t, err)
 
 				res, err := agent.Run(t.Context(), SessionAgentCall{
-					Prompt:          "use bash to create a file named test.txt with content 'hello bash'",
+					Prompt:          "use bash to create a file named test.txt with content 'hello bash'. do not print its timestamp",
 					SessionID:       session.ID,
 					MaxOutputTokens: 10000,
 				})

internal/agent/coordinator.go 🔗

@@ -26,6 +26,7 @@ import (
 	"github.com/charmbracelet/crush/internal/message"
 	"github.com/charmbracelet/crush/internal/permission"
 	"github.com/charmbracelet/crush/internal/session"
+	"golang.org/x/sync/errgroup"
 
 	"charm.land/fantasy/providers/anthropic"
 	"charm.land/fantasy/providers/azure"
@@ -63,6 +64,8 @@ type coordinator struct {
 
 	currentAgent SessionAgent
 	agents       map[string]SessionAgent
+
+	readyWg errgroup.Group
 }
 
 func NewCoordinator(
@@ -106,6 +109,10 @@ func NewCoordinator(
 
 // Run implements Coordinator.
 func (c *coordinator) Run(ctx context.Context, sessionID string, prompt string, attachments ...message.Attachment) (*fantasy.AgentResult, error) {
+	if err := c.readyWg.Wait(); err != nil {
+		return nil, err
+	}
+
 	model := c.currentAgent.Model()
 	maxTokens := model.CatwalkCfg.DefaultMaxTokens
 	if model.ModelCfg.MaxTokens != 0 {
@@ -300,14 +307,15 @@ func (c *coordinator) buildAgent(ctx context.Context, prompt *prompt.Prompt, age
 		c.messages,
 		nil,
 	})
-	go func() {
+	c.readyWg.Go(func() error {
 		tools, err := c.buildTools(ctx, agent)
 		if err != nil {
-			slog.Error("could not init agent tools", "err", err)
-			return
+			return err
 		}
 		result.SetTools(tools)
-	}()
+		return nil
+	})
+
 	return result, nil
 }
 

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/bash_tool.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 774
+    content_length: 802
     host: ""
-    body: '{"max_tokens":40,"messages":[{"content":[{"text":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''\n \u003cthink\u003e\n\n\u003c/think\u003e","type":"text"}],"role":"user"}],"model":"claude-3-5-haiku-20241022","system":[{"text":"you will generate a short title based on the first message a user begins a conversation with\n\n\u003crules\u003e\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n\u003c/rules\u003e\n\n /no_think","type":"text"}],"stream":true}'
+    body: '{"max_tokens":40,"messages":[{"content":[{"text":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''. do not print its timestamp\n \u003cthink\u003e\n\n\u003c/think\u003e","type":"text"}],"role":"user"}],"model":"claude-3-5-haiku-20241022","system":[{"text":"you will generate a short title based on the first message a user begins a conversation with\n\n\u003crules\u003e\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n\u003c/rules\u003e\n\n /no_think","type":"text"}],"stream":true}'
     headers:
       Accept:
       - application/json
@@ -25,46 +25,55 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01Vrcb5K4uiarmFd1jBNtjav","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":147,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}}        }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01VitTYtpvnwj5N6fBKySom4","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":152,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}       }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}        }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}      }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Bash File"} }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Bash"}         }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Creation"}          }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" File"}               }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Basics"}              }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Creation"}    }
+
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" with"}         }
+
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Hello"}          }
+
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Message"}           }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0   }
+      data: {"type":"content_block_stop","index":0  }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":147,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}              }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":152,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":10}          }
 
       event: message_stop
-      data: {"type":"message_stop"  }
+      data: {"type":"message_stop"             }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 539.894084ms
+    duration: 560.092417ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45787
+    content_length: 45989
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/download_tool.yaml 🔗

@@ -25,55 +25,52 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_014PmwWLUvYr6qpsePLJgQuG","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":160,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}   }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01SMGNsdc3MdjnDTj98MeSvC","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":160,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}      }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}  }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Downloa"}           }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Downloa"}            }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Text"}          }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Text"}       }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" File"}               }
-
-      event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" from"}        }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" File from"}}
 
       event: content_block_delta
       data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Example"}        }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" URL"}       }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" URL"}}
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0     }
+      data: {"type":"content_block_stop","index":0  }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":160,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}}
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":160,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}            }
 
       event: message_stop
-      data: {"type":"message_stop" }
+      data: {"type":"message_stop"   }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 659.197333ms
+    duration: 506.850208ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45840
+    content_length: 46014
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/fetch_tool.yaml 🔗

@@ -25,58 +25,55 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01CZZNnv73tmgmvZ2hmoE5cq","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":167,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}           }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_018xCr1DYiCf3jArVxFU59KR","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":167,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}       }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}              }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}        }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Web"}            }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Web"}               }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Page"}}
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Page"}  }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Content"} }
-
-      event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Search"}}
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Search"}       }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" for"}    }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" for"}        }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" John"}         }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" John"}  }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Doe"}      }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Doe"}               }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0  }
+      data: {"type":"content_block_stop","index":0               }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":167,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":11}              }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":167,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":10} }
 
       event: message_stop
-      data: {"type":"message_stop"       }
+      data: {"type":"message_stop" }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 683.59975ms
+    duration: 601.795959ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45858
+    content_length: 46032
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/glob_tool.yaml 🔗

@@ -25,52 +25,49 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01EumvKhSStGmGrbLhmaD2w9","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":142,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}  }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_019rtcSpEMDvDZB1L5jzASu7","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":142,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}    }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}           }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}    }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Fin"} }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Fin"}        }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Go"}           }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Go"}             }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Files"}        }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Files"}           }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Using"}         }
-
-      event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Glob"}             }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in Current Directory"}          }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0          }
+      data: {"type":"content_block_stop","index":0       }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":142,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}            }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":142,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}}
 
       event: message_stop
-      data: {"type":"message_stop"          }
+      data: {"type":"message_stop"             }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 561.838166ms
+    duration: 827.522292ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45776
+    content_length: 45950
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/grep_tool.yaml 🔗

@@ -25,49 +25,49 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01JTVg8ZKQLYPPbkLsWRjsFg","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":144,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}}            }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01RAcxzeTopaX9juzPGBzfRV","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":144,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}           }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}     }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}  }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Searching"}               }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Grep"}    }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Packages"}   }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Package"}          }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in Go Files with"}    }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Search"}            }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Grep"}       }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in Go Files"}            }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0            }
+      data: {"type":"content_block_stop","index":0      }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":144,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":13}          }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":144,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":10} }
 
       event: message_stop
-      data: {"type":"message_stop"    }
+      data: {"type":"message_stop"              }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 583.795541ms
+    duration: 551.294833ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45774
+    content_length: 45948
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/ls_tool.yaml 🔗

@@ -25,55 +25,49 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01NT5ieoGueTkZSoLTaz16VC","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":140,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}}           }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_016Uu4PnZb2k4Sx33HrinmEr","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":140,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}        }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}          }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}     }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Listing Files"}             }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"List"}   }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in Current"}          }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Files"}               }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Directory"}           }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in"}}
 
-      event: ping
-      data: {"type": "ping"}
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Current Directory"}   }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0            }
-
-      event: ping
-      data: {"type": "ping"}
-
-      event: ping
-      data: {"type": "ping"}
+      data: {"type":"content_block_stop","index":0           }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":140,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}           }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":140,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":8}    }
 
       event: message_stop
-      data: {"type":"message_stop"           }
+      data: {"type":"message_stop"            }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 550.03325ms
+    duration: 988.34175ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45768
+    content_length: 45942
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/multiedit_tool.yaml 🔗

@@ -25,13 +25,13 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01PE7VYhsyq2iDhiirgYXrnD","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":170,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}    }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01FjZyvRmmP6f5huYC6M5w9q","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":170,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}   }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}      }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Modify"}  }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Edit"}              }
 
       event: content_block_delta
       data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go"} }
@@ -40,34 +40,37 @@ interactions:
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Program"}            }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Code"}}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Greeting"}               }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Text"}          }
+
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Modification"}    }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0   }
+      data: {"type":"content_block_stop","index":0      }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":170,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}  }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":170,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}   }
 
       event: message_stop
-      data: {"type":"message_stop"              }
+      data: {"type":"message_stop"    }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 1.83986725s
+    duration: 614.803834ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45854
+    content_length: 46028
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/parallel_tool_calls.yaml 🔗

@@ -25,49 +25,55 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01WUPzmEDtBzpSQ3zfN9YRNp","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":159,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}              }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01C8kCFF38gUc1F98cNSb1Je","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":159,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}           }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}          }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Parallel"}      }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Parallel"}       }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go File"}}
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go File"}            }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" an"}   }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Listing"}             }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Directory Listing"}            }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" an"} }
+
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Directory"}             }
+
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Scan"}              }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0              }
+      data: {"type":"content_block_stop","index":0     }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":159,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":11}     }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":159,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":13}              }
 
       event: message_stop
-      data: {"type":"message_stop"        }
+      data: {"type":"message_stop"  }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 827.62075ms
+    duration: 640.574ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45865
+    content_length: 46039
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/read_a_file.yaml 🔗

@@ -25,31 +25,31 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01LyHibm3ysLkpsN7aM5SmbR","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":134,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}             }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_015jTnfBT3pBhzGcY78T5dtG","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":134,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}   }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}         }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}     }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Examine"}       }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Rea"}           }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go"}            }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Go"}            }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Module"}         }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Module"}           }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" File"}    }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Details"}              }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0          }
+      data: {"type":"content_block_stop","index":0     }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":134,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":8}          }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":134,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":7}     }
 
       event: message_stop
       data: {"type":"message_stop"  }
@@ -59,15 +59,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 878.102292ms
+    duration: 534.240625ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45738
+    content_length: 45912
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/simple_test.yaml 🔗

@@ -25,46 +25,46 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_015TMuNhm2VpdL26vPjCVkGV","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":131,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}        }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01RjUuxns7MZVJP9xo7zXJpb","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":131,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}          }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}     }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Quick"} }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Greeting"}  }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Chat"}      }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Receive"}           }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Start"}               }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d"}            }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0}
+      data: {"type":"content_block_stop","index":0           }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":131,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":6}        }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":131,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":7}}
 
       event: message_stop
-      data: {"type":"message_stop"              }
+      data: {"type":"message_stop"      }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 1.14484675s
+    duration: 746.008542ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45728
+    content_length: 45902
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/sourcegraph_tool.yaml 🔗

@@ -25,46 +25,49 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01GytAqerXtvzEKHJJdSpnyY","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":145,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":4,"service_tier":"standard"}}            }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_0195z3mYv7Lex96ZVV3g7ikE","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":145,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}}          }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}   }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}        }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Searching for main"}              }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Searching Go"}            }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" functions"}      }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Repos"}        }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in Go repos"} }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" for Main"}       }
+
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Functions"}        }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0              }
+      data: {"type":"content_block_stop","index":0           }
 
       event: message_delta
       data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":145,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":11}}
 
       event: message_stop
-      data: {"type":"message_stop"      }
+      data: {"type":"message_stop"            }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 821.550416ms
+    duration: 572.207834ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45788
+    content_length: 45962
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/update_a_file.yaml 🔗

@@ -25,49 +25,49 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_017uiUDrbzvGUvd5FsHWQvNi","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":145,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}               }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01A6Qs3G2Urq3zaAYhFxQNDW","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":145,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}       }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}   }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}               }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Update"}        }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Update"}   }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" main"}         }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" main"}              }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".go Hello"}              }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".go Hello"} }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Print"}   }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Message"}      }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0      }
+      data: {"type":"content_block_stop","index":0}
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":145,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}           }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":145,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9}      }
 
       event: message_stop
-      data: {"type":"message_stop"     }
+      data: {"type":"message_stop"        }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 566.924ms
+    duration: 552.206292ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45794
+    content_length: 45968
     host: ""

internal/agent/testdata/TestCoderAgent/anthropic-sonnet/write_tool.yaml 🔗

@@ -25,49 +25,55 @@ interactions:
     content_length: -1
     body: |+
       event: message_start
-      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_011unduGeE6BdA5baBxdT4HL","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":161,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}       }
+      data: {"type":"message_start","message":{"model":"claude-3-5-haiku-20241022","id":"msg_01BvsQtHoFHkXJ1tT8f3apHB","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":161,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}    }
 
       event: content_block_start
-      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}   }
+      data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Create"}         }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Creating"} }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" config"}      }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" config"}            }
 
       event: ping
       data: {"type": "ping"}
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".json with basic"}        }
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".json file"}            }
 
       event: content_block_delta
-      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" settings"}}
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" with"}   }
+
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" JSON"}          }
+
+      event: content_block_delta
+      data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" data"}  }
 
       event: content_block_stop
-      data: {"type":"content_block_stop","index":0          }
+      data: {"type":"content_block_stop","index":0      }
 
       event: message_delta
-      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":161,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":10}         }
+      data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":161,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":11}           }
 
       event: message_stop
-      data: {"type":"message_stop"}
+      data: {"type":"message_stop"      }
 
     headers:
       Content-Type:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 684.963041ms
+    duration: 569.883ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 45831
+    content_length: 46005
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/bash_tool.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 724
+    content_length: 752
     host: ""
-    body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n<rules>\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''\n <think>\n\n</think>","role":"user"}],"model":"gpt-4o","max_tokens":40,"stream_options":{"include_usage":true},"stream":true}'
+    body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n<rules>\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''. do not print its timestamp\n <think>\n\n</think>","role":"user"}],"model":"gpt-4o","max_tokens":40,"stream_options":{"include_usage":true},"stream":true}'
     headers:
       Accept:
       - application/json
@@ -24,25 +24,25 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xeE0RFXRxxO55q"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dPfRtCklVGPSLq"}
 
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"Creating"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"cgSejht8"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Create"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"3CGkCwblCY"}
 
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bqgG6kba7Zjm6b"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"oIjvexf0CnIPO7"}
 
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YecbiX7fxXv"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KshWvicCVvK"}
 
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"b72NKAWSgv7"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"k72piYp6kyfVe"}
 
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Content"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"aHXRi22C"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Bash"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"C2cr4u4USNi"}
 
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Using"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5QnS7kDWcT"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Without"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dI3i42bz"}
 
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Bash"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"XQEKqn4AFg9"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Timestamp"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VdcMJZ"}
 
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"EIvpqD2Mwv"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"i4Wcz3RpqM"}
 
-      data: {"id":"chatcmpl-CVGgw7EnMqgImV3IRSsBOkqHvrLyx","object":"chat.completion.chunk","created":1761568366,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[],"usage":{"prompt_tokens":139,"completion_tokens":7,"total_tokens":146,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"HTwltwCinqzkvH"}
+      data: {"id":"chatcmpl-CVz85CQ0qlWRtpRhywMn7QxqYeUYQ","object":"chat.completion.chunk","created":1761739185,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":145,"completion_tokens":7,"total_tokens":152,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"wLpzGFATixr61S"}
 
       data: [DONE]
 
@@ -51,15 +51,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 472.351333ms
+    duration: 483.992958ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44232
+    content_length: 44434
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/download_tool.yaml 🔗

@@ -24,23 +24,25 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGhFH8lxWxXLxqDY58ODKarEzqKy","object":"chat.completion.chunk","created":1761568385,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"4QHabbGK6DjmzQ"}
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"RwvYFz0dPL8l0W"}
 
-      data: {"id":"chatcmpl-CVGhFH8lxWxXLxqDY58ODKarEzqKy","object":"chat.completion.chunk","created":1761568385,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":"Download"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"coOtETsj"}
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Downloading"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CqJV6"}
 
-      data: {"id":"chatcmpl-CVGhFH8lxWxXLxqDY58ODKarEzqKy","object":"chat.completion.chunk","created":1761568385,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gF9Cc0sX92ke"}
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MPLHEWMpGNMy"}
 
-      data: {"id":"chatcmpl-CVGhFH8lxWxXLxqDY58ODKarEzqKy","object":"chat.completion.chunk","created":1761568385,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" Save"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"sH2XMaxQwyH"}
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Saving"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"OfMw5WYWH"}
 
-      data: {"id":"chatcmpl-CVGhFH8lxWxXLxqDY58ODKarEzqKy","object":"chat.completion.chunk","created":1761568385,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" Example"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"S2u9pOyT"}
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"o3iIHjAqucSGGm"}
 
-      data: {"id":"chatcmpl-CVGhFH8lxWxXLxqDY58ODKarEzqKy","object":"chat.completion.chunk","created":1761568385,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" Text"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CbyaZmOloQu"}
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"rxRYblxgwlo"}
 
-      data: {"id":"chatcmpl-CVGhFH8lxWxXLxqDY58ODKarEzqKy","object":"chat.completion.chunk","created":1761568385,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"28jhPEbqYhZ"}
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" from"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KSaPxJ74eiy"}
 
-      data: {"id":"chatcmpl-CVGhFH8lxWxXLxqDY58ODKarEzqKy","object":"chat.completion.chunk","created":1761568385,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"si1kJlCIWU"}
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" URL"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"NTcNYugpWc6J"}
 
-      data: {"id":"chatcmpl-CVGhFH8lxWxXLxqDY58ODKarEzqKy","object":"chat.completion.chunk","created":1761568385,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[],"usage":{"prompt_tokens":148,"completion_tokens":6,"total_tokens":154,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"jgKacbi7oLSzdQ"}
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"ZdzoBm7g8D"}
+
+      data: {"id":"chatcmpl-CVz8ORCoQnKn39RNjD1Lf8o75Wf0z","object":"chat.completion.chunk","created":1761739204,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":148,"completion_tokens":7,"total_tokens":155,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"TbRv7pp8ket1UJ"}
 
       data: [DONE]
 
@@ -49,15 +51,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 454.701458ms
+    duration: 563.767708ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44285
+    content_length: 44459
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/fetch_tool.yaml 🔗

@@ -24,29 +24,31 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"daVnpgPm4VmR7B"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ZSodjBgdEw6KCJ"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":"Check"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Mg3MvWaG76d"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Checking"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bF12rabT"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VwkfaVdl3z9Y"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" if"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Qfmp4QtXXMBJ2"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"JdN1PE3S5FXm3t"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HFTQeLI6UiLT25"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":"John"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"4CCiMjneah7e"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"John"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UI4PYSxRbpnM"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" Doe"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"7NTt4Yvg1D2c"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Doe"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ojMKfmvfUFg4"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HkXpfCTvuVl2pNc"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qkbwGKQtasDxjsc"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"m9DReCKdlNvWp"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Exists"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"PWMxS15Ep"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" Website"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Kd9GrIrH"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" on"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"8AEgYShpeKANP"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{"content":" Content"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"lx9dGCom"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Example"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"i5ULrBVE"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"Qtc6CmsT1o"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" HTML"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"b1Y4cutYF16"}
 
-      data: {"id":"chatcmpl-CVGhPuALM21rTRM7PcoObvpGZgohg","object":"chat.completion.chunk","created":1761568395,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a788c5aef0","choices":[],"usage":{"prompt_tokens":153,"completion_tokens":9,"total_tokens":162,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"GHzJW3rpScLqX6"}
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"7b6R8Pa8K7"}
+
+      data: {"id":"chatcmpl-CVz8Z1N4lDfIKxM3aKQXbLTiNKzfZ","object":"chat.completion.chunk","created":1761739215,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":153,"completion_tokens":10,"total_tokens":163,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"NJ9Mpy4WpGAPz"}
 
       data: [DONE]
 
@@ -55,15 +57,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 467.236ms
+    duration: 466.436917ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44303
+    content_length: 44477
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/glob_tool.yaml 🔗

@@ -24,29 +24,29 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"8jgsvvnWfkWFyo"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"E7kaF9NObIZFla"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"Finding"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Y6d3F70UA"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Finding"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VbMVqy1KJ"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" ."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"rHONqHy6BbmtbU"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" ."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"eWVVzxYqslpGup"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5GlwsFjPubzbBn"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"yuwvS6J1n7FYdl"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wciSGQi9QH"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"nWBgo5PP8U"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"sG5AX8fYNC6"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"jfCy4U9cFjj"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Glob"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"FnSrmXBHQnT"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Glob"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KKQl6QiQWnt"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"7O9XexmyzCGCg"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HxbWz6VBDUpff"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"aylb4NNf"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QLwGYffq"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Directory"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HCktzv"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Directory"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SXUCMF"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"IhEHGfQ0jl"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"XHDEivoJLE"}
 
-      data: {"id":"chatcmpl-CVGhYvOetx4fuImilVyL6dWeEWRLC","object":"chat.completion.chunk","created":1761568404,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[],"usage":{"prompt_tokens":137,"completion_tokens":9,"total_tokens":146,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"BaC1XCxBGlLeEW"}
+      data: {"id":"chatcmpl-CVz8nkACA1RsQpVgdlsFtHBkPgEjH","object":"chat.completion.chunk","created":1761739229,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":137,"completion_tokens":9,"total_tokens":146,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"ZQpOdtfy9BHSzt"}
 
       data: [DONE]
 
@@ -55,15 +55,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 492.080083ms
+    duration: 672.036958ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44221
+    content_length: 44395
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/grep_tool.yaml 🔗

@@ -24,31 +24,33 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"WMfgWjD9b4iboA"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ahKhyTWfKpnSNX"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"Search"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ISDGMho3Un"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Using"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"OMUcUyQXmXS"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"eVSBw2NEMvHs"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Gre"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ExmDSgnleUNM"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"kWRALmg09l0feY"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"p"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"su01FSZqFiUkvbC"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"package"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Qmc7wOPOw"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tcKXxtEspOODx"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ceGaOGVIPpVreHS"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Find"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SnppB5u8iZh"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"BMIfRzXwpMDVy"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6YYmrtrzGibewT"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wTmsx9mk1TlJi"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Package"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"okrR2yd76"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"S1J7O84ihu"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GiDYz9Ujv3CEhdo"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" using"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UCcyS79ip7"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"H0dMz9bYeCrQV"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" grep"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MsGm3j68Uns"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qXNyYxUt2IC7r"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"Dlv6SEJZZe"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"k4yGSJkTED"}
 
-      data: {"id":"chatcmpl-CVGhcAVHb35eOkzllQyaarsJHQRRM","object":"chat.completion.chunk","created":1761568408,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[],"usage":{"prompt_tokens":138,"completion_tokens":10,"total_tokens":148,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"537NaK1vnhWQ7"}
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"dEm4izpMZ3"}
+
+      data: {"id":"chatcmpl-CVz8u8rtmrPrnOnMfyPeNyeEqUUrD","object":"chat.completion.chunk","created":1761739236,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":138,"completion_tokens":11,"total_tokens":149,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"6OFFvxMCHtM5j"}
 
       data: [DONE]
 
@@ -57,15 +59,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 398.25575ms
+    duration: 908.098416ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44219
+    content_length: 44393
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/ls_tool.yaml 🔗

@@ -24,21 +24,25 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGhi7Jyhoss9Dn7fKn3WhVJcS8r7","object":"chat.completion.chunk","created":1761568414,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xOBWtkw676hxWd"}
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5QixgozlJLHplQ"}
 
-      data: {"id":"chatcmpl-CVGhi7Jyhoss9Dn7fKn3WhVJcS8r7","object":"chat.completion.chunk","created":1761568414,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"List"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QNax3zNXou2U"}
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"List"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"u8ABYV1Emeo0"}
 
-      data: {"id":"chatcmpl-CVGhi7Jyhoss9Dn7fKn3WhVJcS8r7","object":"chat.completion.chunk","created":1761568414,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Uwb07Q74LB"}
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"S951WhiNf6"}
 
-      data: {"id":"chatcmpl-CVGhi7Jyhoss9Dn7fKn3WhVJcS8r7","object":"chat.completion.chunk","created":1761568414,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"3lyChTLFVw9"}
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YudcskZEywucf"}
 
-      data: {"id":"chatcmpl-CVGhi7Jyhoss9Dn7fKn3WhVJcS8r7","object":"chat.completion.chunk","created":1761568414,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" LS"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wm9yf3iMXBldO"}
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Directory"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tjJf66"}
 
-      data: {"id":"chatcmpl-CVGhi7Jyhoss9Dn7fKn3WhVJcS8r7","object":"chat.completion.chunk","created":1761568414,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Command"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xfnGgqY4"}
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Using"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6NpmB69Xbd"}
 
-      data: {"id":"chatcmpl-CVGhi7Jyhoss9Dn7fKn3WhVJcS8r7","object":"chat.completion.chunk","created":1761568414,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"FZkAxIrL1f"}
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" ls"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"S1TPsqQSetufh"}
 
-      data: {"id":"chatcmpl-CVGhi7Jyhoss9Dn7fKn3WhVJcS8r7","object":"chat.completion.chunk","created":1761568414,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[],"usage":{"prompt_tokens":135,"completion_tokens":5,"total_tokens":140,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"lfFIBahqXvb3hZ"}
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Command"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"kt6iCrf5"}
+
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"hcQCwYw5aa"}
+
+      data: {"id":"chatcmpl-CVz93jAyx5CeFxsv9A8SSZpefq5qN","object":"chat.completion.chunk","created":1761739245,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":135,"completion_tokens":7,"total_tokens":142,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"NTja3di3JtfoUc"}
 
       data: [DONE]
 
@@ -47,15 +51,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 369.083375ms
+    duration: 516.491041ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44213
+    content_length: 44387
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/multiedit_tool.yaml 🔗

@@ -24,41 +24,27 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5gkEgWjVTOTnSL"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"A5mPC2w49X7e4L"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"Editing"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MJZGSrCzh"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Code"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SS1H1FSBIjyj"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ltbJ0K1ZnvBT2D"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Update"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Ib9alVmik"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VUqmP0WPp25"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":":"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"eyZSLrijBAyTFBv"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"foPXZoVvjJKtuGi"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Modify"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AB1TfytG6"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" World"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"idwQToDE9N"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Greeting"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Kw2tOAz"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"!'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gk6ZAJROv7rnrl"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"J2VONZuhdNWT"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2ZBbXXBj0bMlP"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Add"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"rwzswcLQzBX3"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"hXlZ1hGxiN5qAG"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Comment"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ynC8NzJt"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"v8WgKqzNTnK"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"IzNrxqGDIw"}
 
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9NcEasUlux5vRzJ"}
-
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Crush"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9JNKf9qEar"}
-
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"!'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"yzlrO15jy63gQI"}
-
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5kd6G2rJg7wxq"}
-
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SSJtEfm08MA"}
-
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":".go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CdqyTSYSbWOhl"}
-
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"IC4DFCRQ5M"}
-
-      data: {"id":"chatcmpl-CVGhq42hILaUefpj0DqO1tqILLmD1","object":"chat.completion.chunk","created":1761568422,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[],"usage":{"prompt_tokens":157,"completion_tokens":15,"total_tokens":172,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"bfvjwG8g2WIVE"}
+      data: {"id":"chatcmpl-CVz9BYtDNy4C04jozEiPEmpYjut38","object":"chat.completion.chunk","created":1761739253,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":157,"completion_tokens":8,"total_tokens":165,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"tMyXWmzN6vgaQN"}
 
       data: [DONE]
 
@@ -67,15 +53,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 450.499625ms
+    duration: 652.283291ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44299
+    content_length: 44473
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/parallel_tool_calls.yaml 🔗

@@ -24,27 +24,31 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"a4aeRi5yFSlp0I"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"fBW8ERonoDjPp2"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"Run"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"t2xAJAB6ghrBG"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Run"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"NOY0xKDAXaeZT"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Glob"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"4pCqp3PwUND"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" glob"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"fUFLgRivvgn"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2kaRZRnwpUAe"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"34SQZ5YlfwUq"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" List"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"DGlQBn5dN0d"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" ls"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"BtIV3GCECJAvH"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Directory"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qA6cbc"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"odxkkaok1GA0n"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Commands"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2T7v8NG"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" parallel"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UTPm4Nz"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YNcH8yF2P72JO"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"1bSYd379FCmf"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Parallel"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"FeNGcH6"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" ."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dHc9swaGTqacpR"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"7kjQteMuZa"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"jaW5KAJBdyX7qt"}
 
-      data: {"id":"chatcmpl-CVGitmInvDHUk3ghtpsrmlVjuVGTU","object":"chat.completion.chunk","created":1761568487,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[],"usage":{"prompt_tokens":154,"completion_tokens":8,"total_tokens":162,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"FeAhrzodraw7Ux"}
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Yk6ndaqjh4"}
+
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"K4garAYdiS"}
+
+      data: {"id":"chatcmpl-CVzA7h3O81W7Kcav9cNqmaQrk7Pio","object":"chat.completion.chunk","created":1761739311,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":154,"completion_tokens":10,"total_tokens":164,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"eTseDtFteVPsV"}
 
       data: [DONE]
 
@@ -53,15 +57,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 540.224584ms
+    duration: 629.818375ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44310
+    content_length: 44484
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/read_a_file.yaml 🔗

@@ -24,21 +24,19 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGgMcB2H6chf7ibfnben6NUw4V9K","object":"chat.completion.chunk","created":1761568330,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"apaIEpOt1Lv30W"}
+      data: {"id":"chatcmpl-CVz7RYyWicHAaNOUrX5BVio64NXIk","object":"chat.completion.chunk","created":1761739145,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"NHRD5WcbQjF9Kv"}
 
-      data: {"id":"chatcmpl-CVGgMcB2H6chf7ibfnben6NUw4V9K","object":"chat.completion.chunk","created":1761568330,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Understanding"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"fQI"}
+      data: {"id":"chatcmpl-CVz7RYyWicHAaNOUrX5BVio64NXIk","object":"chat.completion.chunk","created":1761739145,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Understanding"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AfS"}
 
-      data: {"id":"chatcmpl-CVGgMcB2H6chf7ibfnben6NUw4V9K","object":"chat.completion.chunk","created":1761568330,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" the"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mqEHqLJ1DgON"}
+      data: {"id":"chatcmpl-CVz7RYyWicHAaNOUrX5BVio64NXIk","object":"chat.completion.chunk","created":1761739145,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2FyAfb5Cut7hl"}
 
-      data: {"id":"chatcmpl-CVGgMcB2H6chf7ibfnben6NUw4V9K","object":"chat.completion.chunk","created":1761568330,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Od2RJv56zmbd4"}
+      data: {"id":"chatcmpl-CVz7RYyWicHAaNOUrX5BVio64NXIk","object":"chat.completion.chunk","created":1761739145,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Mod"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AOvLcw6QL6u6"}
 
-      data: {"id":"chatcmpl-CVGgMcB2H6chf7ibfnben6NUw4V9K","object":"chat.completion.chunk","created":1761568330,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Mod"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0uI6JRpIbhik"}
+      data: {"id":"chatcmpl-CVz7RYyWicHAaNOUrX5BVio64NXIk","object":"chat.completion.chunk","created":1761739145,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bYx0QbUXIC"}
 
-      data: {"id":"chatcmpl-CVGgMcB2H6chf7ibfnben6NUw4V9K","object":"chat.completion.chunk","created":1761568330,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"WqDWfUxqT7N"}
+      data: {"id":"chatcmpl-CVz7RYyWicHAaNOUrX5BVio64NXIk","object":"chat.completion.chunk","created":1761739145,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"8AZHBANsEj"}
 
-      data: {"id":"chatcmpl-CVGgMcB2H6chf7ibfnben6NUw4V9K","object":"chat.completion.chunk","created":1761568330,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"x2SrMiFEUY"}
-
-      data: {"id":"chatcmpl-CVGgMcB2H6chf7ibfnben6NUw4V9K","object":"chat.completion.chunk","created":1761568330,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":129,"completion_tokens":5,"total_tokens":134,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"jeaKOvik3s8Q6x"}
+      data: {"id":"chatcmpl-CVz7RYyWicHAaNOUrX5BVio64NXIk","object":"chat.completion.chunk","created":1761739145,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":129,"completion_tokens":4,"total_tokens":133,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"YZdL8KWfASsgF3"}
 
       data: [DONE]
 
@@ -47,15 +45,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 1.285439917s
+    duration: 1.260231917s
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44183
+    content_length: 44357
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/simple_test.yaml 🔗

@@ -24,13 +24,15 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGgIlcuUPUgTFTaxIIJg2MagUj0v","object":"chat.completion.chunk","created":1761568326,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"IZx6CcUfIt2KuR"}
+      data: {"id":"chatcmpl-CVz7MIPSHlXphCyxpyRBWksQLSvTb","object":"chat.completion.chunk","created":1761739140,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"1vowxVSXtxJ2d4"}
 
-      data: {"id":"chatcmpl-CVGgIlcuUPUgTFTaxIIJg2MagUj0v","object":"chat.completion.chunk","created":1761568326,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Greetings"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"rKiBgyR"}
+      data: {"id":"chatcmpl-CVz7MIPSHlXphCyxpyRBWksQLSvTb","object":"chat.completion.chunk","created":1761739140,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Greeting"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KJBxcZr3"}
 
-      data: {"id":"chatcmpl-CVGgIlcuUPUgTFTaxIIJg2MagUj0v","object":"chat.completion.chunk","created":1761568326,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"DG0zqpmzVN"}
+      data: {"id":"chatcmpl-CVz7MIPSHlXphCyxpyRBWksQLSvTb","object":"chat.completion.chunk","created":1761739140,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Message"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2ChAiMG4"}
 
-      data: {"id":"chatcmpl-CVGgIlcuUPUgTFTaxIIJg2MagUj0v","object":"chat.completion.chunk","created":1761568326,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":126,"completion_tokens":1,"total_tokens":127,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"EoizgPBmF7w7Nz"}
+      data: {"id":"chatcmpl-CVz7MIPSHlXphCyxpyRBWksQLSvTb","object":"chat.completion.chunk","created":1761739140,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"UbBkoFM6re"}
+
+      data: {"id":"chatcmpl-CVz7MIPSHlXphCyxpyRBWksQLSvTb","object":"chat.completion.chunk","created":1761739140,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":126,"completion_tokens":2,"total_tokens":128,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"vPzxvpR8ryY52U"}
 
       data: [DONE]
 
@@ -39,15 +41,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 1.324534041s
+    duration: 859.302541ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44173
+    content_length: 44347
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/sourcegraph_tool.yaml 🔗

@@ -24,35 +24,31 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ixnmUJ8obB6uBi"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"fe0CpOYZlazOH5"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"Source"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QR7SNUWQ1Y"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Searching"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"niEOlyZ"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"graph"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9E1fFP2u8J9"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"u6E8aJR0iMA3"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Search"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9hUvGnwG4"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"t0LrHYO84mGtQV"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"31XxJZSjLUPv"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"func"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GAQWvwLXiX3M"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Q3xUeiN9ZoH6NU"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"jfdD4Xk3zVv"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"func"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"8vjQ0fzM8QC7"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"x1s9HJnIiJmigtW"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"pbuIr5n7cvu"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AVSl72ugYDvrX"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6kKbbNu09n97dVU"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"C79tD3LVf9TJB"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"n23GeR4Uz7t6a"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Re"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Lnc2wuAP1DFi2"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"7XyPO1dq9jmkl"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"positories"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"NeTuNV"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Re"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"7Ij86xvDDzfZv"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"QEVxkLwgD4"}
 
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"positories"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qn0ZwJ"}
-
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"fqiXVhGjgI"}
-
-      data: {"id":"chatcmpl-CVGiG90SMNuOn9XXeMNLflY1ElZi6","object":"chat.completion.chunk","created":1761568448,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[],"usage":{"prompt_tokens":138,"completion_tokens":12,"total_tokens":150,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"bTPxPd41zU01A"}
+      data: {"id":"chatcmpl-CVz9NVZBhmFDLAKKev5QLaOCWUO9O","object":"chat.completion.chunk","created":1761739265,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":138,"completion_tokens":10,"total_tokens":148,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"dJfT8DVIT9w0K"}
 
       data: [DONE]
 
@@ -61,15 +57,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 308.459834ms
+    duration: 448.444542ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44233
+    content_length: 44407
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/update_a_file.yaml 🔗

@@ -24,31 +24,25 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"IY2Eq7gGIsOgUz"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"X6UJgdERVeZftx"}
 
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Update"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"D1nUboowC9"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[{"index":0,"delta":{"content":"Update"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0mP6avxjgD"}
 
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SZwn7uaWLCD"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[{"index":0,"delta":{"content":" Print"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6uSgVowxbg"}
 
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":".go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"BbsF19s1OIgHO"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[{"index":0,"delta":{"content":" Statement"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"J6rKIU"}
 
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"sfrG6zaff8sk8"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HUKnpRUoNzTaa"}
 
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Print"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KDBwSoALh8"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5XXcdcHGSpW"}
 
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" \""},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"4kpM1gchpdQE5"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[{"index":0,"delta":{"content":".go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Lw0ACzS7NeDnv"}
 
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"d9PjJkD5DFI"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"cK7347ocgYS"}
 
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" from"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"4a4JFXfXaf1"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"57cdGQmo0R"}
 
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Crush"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Lh6ynY8ifg"}
-
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"\""},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Qz7L5qf0Yua76t"}
-
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"o5KKiw6AYx"}
-
-      data: {"id":"chatcmpl-CVGgWgdan0OFWBzYbomjj9H79jB7a","object":"chat.completion.chunk","created":1761568340,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":139,"completion_tokens":10,"total_tokens":149,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"hLglFwp4kh5qG"}
+      data: {"id":"chatcmpl-CVz7cLwcqlyipViB3KQ0SHCuvoCcD","object":"chat.completion.chunk","created":1761739156,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_65564d8ba5","choices":[],"usage":{"prompt_tokens":139,"completion_tokens":7,"total_tokens":146,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"ScSeP3iMu5yYl2"}
 
       data: [DONE]
 
@@ -57,15 +51,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 1.06013175s
+    duration: 485.046167ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44239
+    content_length: 44413
     host: ""

internal/agent/testdata/TestCoderAgent/openai-gpt-5/write_tool.yaml 🔗

@@ -24,25 +24,23 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"i00526ssJzwsl3"}
+      data: {"id":"chatcmpl-CVz9pqBh43nAYUGjA4HmpNmfVpUvH","object":"chat.completion.chunk","created":1761739293,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"yvRftXRjka0BLl"}
 
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"Create"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"suOtyuirSC"}
+      data: {"id":"chatcmpl-CVz9pqBh43nAYUGjA4HmpNmfVpUvH","object":"chat.completion.chunk","created":1761739293,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Create"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"fZcBPhRtnG"}
 
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" config"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"jy5v2mzrs"}
+      data: {"id":"chatcmpl-CVz9pqBh43nAYUGjA4HmpNmfVpUvH","object":"chat.completion.chunk","created":1761739293,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" config"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UYN60fFyW"}
 
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":".json"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"7hI97Dt5J6A"}
+      data: {"id":"chatcmpl-CVz9pqBh43nAYUGjA4HmpNmfVpUvH","object":"chat.completion.chunk","created":1761739293,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":".json"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"arJ5vFKUof9"}
 
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6RHYW9MTMxp"}
+      data: {"id":"chatcmpl-CVz9pqBh43nAYUGjA4HmpNmfVpUvH","object":"chat.completion.chunk","created":1761739293,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"jkl1Cyas5JJ"}
 
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Spec"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ZBAFtp3HecS"}
+      data: {"id":"chatcmpl-CVz9pqBh43nAYUGjA4HmpNmfVpUvH","object":"chat.completion.chunk","created":1761739293,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" JSON"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YNOesLqjiP7"}
 
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":"ified"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2wvMGS6tpxu"}
+      data: {"id":"chatcmpl-CVz9pqBh43nAYUGjA4HmpNmfVpUvH","object":"chat.completion.chunk","created":1761739293,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Content"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tyZHLJ74"}
 
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{"content":" Content"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"XZD1dorH"}
+      data: {"id":"chatcmpl-CVz9pqBh43nAYUGjA4HmpNmfVpUvH","object":"chat.completion.chunk","created":1761739293,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"XgpssLlNl0"}
 
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"tmeMGL1EMh"}
-
-      data: {"id":"chatcmpl-CVGikAnxooSxlojhF3G0KR5j7Mvdq","object":"chat.completion.chunk","created":1761568478,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_eb3c3cb84d","choices":[],"usage":{"prompt_tokens":153,"completion_tokens":7,"total_tokens":160,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"l2u0BaSfnEV0wE"}
+      data: {"id":"chatcmpl-CVz9pqBh43nAYUGjA4HmpNmfVpUvH","object":"chat.completion.chunk","created":1761739293,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":153,"completion_tokens":6,"total_tokens":159,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"ElEHEb9B9kNRsi"}
 
       data: [DONE]
 
@@ -51,15 +49,15 @@ interactions:
       - text/event-stream; charset=utf-8
     status: 200 OK
     code: 200
-    duration: 391.584125ms
+    duration: 504.447625ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44276
+    content_length: 44450
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/bash_tool.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 775
+    content_length: 803
     host: ""
-    body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n<rules>\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''\n <think>\n\n</think>","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}'
+    body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n<rules>\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''. do not print its timestamp\n <think>\n\n</think>","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}'
     headers:
       Accept:
       - application/json
@@ -24,27 +24,21 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739340-MhErwSz7AYBvQhO2456S","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739340,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739340-MhErwSz7AYBvQhO2456S","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739340,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":" test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739340-MhErwSz7AYBvQhO2456S","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739340,"choices":[{"index":0,"delta":{"role":"assistant","content":" test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739340-MhErwSz7AYBvQhO2456S","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739340,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739340-MhErwSz7AYBvQhO2456S","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739340,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello bash using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739340-MhErwSz7AYBvQhO2456S","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739340,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739340-MhErwSz7AYBvQhO2456S","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739340,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
 
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
-
-      data: {"id":"gen-1761568516-RyL9kxWAV214dAvNh60l","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568516,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":141,"completion_tokens":9,"total_tokens":150,"cost":0.00002964,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001974,"upstream_inference_completions_cost":0.0000099},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739340-MhErwSz7AYBvQhO2456S","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739340,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":147,"completion_tokens":9,"total_tokens":156,"cost":0.0000468,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000441,"upstream_inference_completions_cost":0.0000027},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -53,15 +47,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 618.777917ms
+    duration: 1.509632708s
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44344
+    content_length: 44546
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/download_tool.yaml 🔗

@@ -24,21 +24,31 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761568522-ZTuYUxWHmOKgcj5t3hgX","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568522,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568522-ZTuYUxWHmOKgcj5t3hgX","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568522,"choices":[{"index":0,"delta":{"role":"assistant","content":"Download"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":"Download"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568522-ZTuYUxWHmOKgcj5t3hgX","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568522,"choices":[{"index":0,"delta":{"role":"assistant","content":" example"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":" example"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568522-ZTuYUxWHmOKgcj5t3hgX","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568522,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt from example"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568522-ZTuYUxWHmOKgcj5t3hgX","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568522,"choices":[{"index":0,"delta":{"role":"assistant","content":"-files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":" from"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568522-ZTuYUxWHmOKgcj5t3hgX","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568522,"choices":[{"index":0,"delta":{"role":"assistant","content":".online-convert.com"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":" example"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568522-ZTuYUxWHmOKgcj5t3hgX","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568522,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""}
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":"-files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568522-ZTuYUxWHmOKgcj5t3hgX","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568522,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":154,"completion_tokens":10,"total_tokens":164,"cost":0.0000381,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000231,"upstream_inference_completions_cost":0.000015},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":".online"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":"-"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":"convert"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":".com"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+      data: {"id":"gen-1761739349-jppiI9wtIfPLJgIWJYHu","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739349,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":150,"completion_tokens":11,"total_tokens":161,"cost":0.0000238,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000015,"upstream_inference_completions_cost":0.0000088},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -47,15 +57,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 845.475334ms
+    duration: 595.46175ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44397
+    content_length: 44571
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/fetch_tool.yaml 🔗

@@ -24,25 +24,25 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":"Check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":"Check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":" if"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":" if"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":" example"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":" example"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":".html"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":".html"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":" contains"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":" contains"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":" John"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":" John"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":" Doe"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":" Doe"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
 
-      data: {"id":"gen-1761568527-YXiJhQNClogNRxPR2kjt","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568527,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":155,"completion_tokens":8,"total_tokens":163,"cost":0.0000305,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000217,"upstream_inference_completions_cost":0.0000088},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739353-7uwZ5o6Mg2R3OxXIJzTD","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739353,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":155,"completion_tokens":8,"total_tokens":163,"cost":0.0000243,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000155,"upstream_inference_completions_cost":0.0000088},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -51,15 +51,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 618.6605ms
+    duration: 578.888709ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44415
+    content_length: 44589
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/glob_tool.yaml 🔗

@@ -24,31 +24,19 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739365-9tYIRPaRwzq4zyeyutpR","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739365,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":"Find"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739365-9tYIRPaRwzq4zyeyutpR","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739365,"choices":[{"index":0,"delta":{"role":"assistant","content":"Find"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":" all"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739365-9tYIRPaRwzq4zyeyutpR","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739365,"choices":[{"index":0,"delta":{"role":"assistant","content":" all .go files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":" ."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739365-9tYIRPaRwzq4zyeyutpR","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739365,"choices":[{"index":0,"delta":{"role":"assistant","content":" in current directory using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739365-9tYIRPaRwzq4zyeyutpR","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739365,"choices":[{"index":0,"delta":{"role":"assistant","content":" glob"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739365-9tYIRPaRwzq4zyeyutpR","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739365,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
 
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":" glob"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
-
-      data: {"id":"gen-1761568547-A8LqjOlxsuNXarVj6g5L","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568548,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":139,"completion_tokens":11,"total_tokens":150,"cost":0.00003156,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001946,"upstream_inference_completions_cost":0.0000121},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739365-9tYIRPaRwzq4zyeyutpR","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739365,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":139,"completion_tokens":11,"total_tokens":150,"cost":0.000045,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000417,"upstream_inference_completions_cost":0.0000033},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -57,15 +45,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 616.1375ms
+    duration: 866.379167ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44333
+    content_length: 44507
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/grep_tool.yaml 🔗

@@ -24,19 +24,27 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761569094-JynqNDKXnjQbi1SAA7uQ","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569094,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569094-JynqNDKXnjQbi1SAA7uQ","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569094,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":"Search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569094-JynqNDKXnjQbi1SAA7uQ","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569094,"choices":[{"index":0,"delta":{"role":"assistant","content":"Search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569094-JynqNDKXnjQbi1SAA7uQ","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569094,"choices":[{"index":0,"delta":{"role":"assistant","content":" for package in Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":" package"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569094-JynqNDKXnjQbi1SAA7uQ","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569094,"choices":[{"index":0,"delta":{"role":"assistant","content":" files using grep"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569094-JynqNDKXnjQbi1SAA7uQ","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569094,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":" go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569094-JynqNDKXnjQbi1SAA7uQ","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569094,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":140,"completion_tokens":9,"total_tokens":149,"cost":0.0000295,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000196,"upstream_inference_completions_cost":0.0000099},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":" grep"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+      data: {"id":"gen-1761739368-d3cedwgttisP1LWVaMoF","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739368,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":140,"completion_tokens":9,"total_tokens":149,"cost":0.0000212,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000014,"upstream_inference_completions_cost":0.0000072},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -45,15 +53,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 584.888125ms
+    duration: 1.196160875s
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44331
+    content_length: 44505
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/ls_tool.yaml 🔗

@@ -24,19 +24,25 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761569101-TtIOfTGCpXrP5vbrikIM","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569101,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569101-TtIOfTGCpXrP5vbrikIM","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569101,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":"List"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569101-TtIOfTGCpXrP5vbrikIM","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569101,"choices":[{"index":0,"delta":{"role":"assistant","content":"List"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569101-TtIOfTGCpXrP5vbrikIM","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569101,"choices":[{"index":0,"delta":{"role":"assistant","content":" files in current directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569101-TtIOfTGCpXrP5vbrikIM","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569101,"choices":[{"index":0,"delta":{"role":"assistant","content":" using ls"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569101-TtIOfTGCpXrP5vbrikIM","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569101,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569101-TtIOfTGCpXrP5vbrikIM","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569101,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":137,"completion_tokens":8,"total_tokens":145,"cost":0.00002798,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001918,"upstream_inference_completions_cost":0.0000088},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":" ls"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+      data: {"id":"gen-1761739375-MQ1rVq0evwsr6N2PEE68","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739375,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":137,"completion_tokens":8,"total_tokens":145,"cost":0.0000225,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000137,"upstream_inference_completions_cost":0.0000088},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -45,15 +51,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 285.355208ms
+    duration: 552.375417ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44325
+    content_length: 44499
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/multiedit_tool.yaml 🔗

@@ -24,21 +24,21 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761569103-Zz1p16Wps6BNZDMsX4uw","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569103,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739379-8wX8woLDnS1q1V3VLm9P","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739379,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569103-Zz1p16Wps6BNZDMsX4uw","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569103,"choices":[{"index":0,"delta":{"role":"assistant","content":"Use"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739379-8wX8woLDnS1q1V3VLm9P","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739379,"choices":[{"index":0,"delta":{"role":"assistant","content":"Use"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569103-Zz1p16Wps6BNZDMsX4uw","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569103,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiedit to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739379-8wX8woLDnS1q1V3VLm9P","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739379,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiedit to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569103-Zz1p16Wps6BNZDMsX4uw","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569103,"choices":[{"index":0,"delta":{"role":"assistant","content":" update greeting"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739379-8wX8woLDnS1q1V3VLm9P","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739379,"choices":[{"index":0,"delta":{"role":"assistant","content":" update greeting"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569103-Zz1p16Wps6BNZDMsX4uw","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569103,"choices":[{"index":0,"delta":{"role":"assistant","content":" and add comment in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739379-8wX8woLDnS1q1V3VLm9P","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739379,"choices":[{"index":0,"delta":{"role":"assistant","content":" and add comment in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569103-Zz1p16Wps6BNZDMsX4uw","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569103,"choices":[{"index":0,"delta":{"role":"assistant","content":" main.go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739379-8wX8woLDnS1q1V3VLm9P","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739379,"choices":[{"index":0,"delta":{"role":"assistant","content":" main.go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569103-Zz1p16Wps6BNZDMsX4uw","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569103,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+      data: {"id":"gen-1761739379-8wX8woLDnS1q1V3VLm9P","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739379,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
 
-      data: {"id":"gen-1761569103-Zz1p16Wps6BNZDMsX4uw","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569103,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":160,"completion_tokens":14,"total_tokens":174,"cost":0.000045,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000024,"upstream_inference_completions_cost":0.000021},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739379-8wX8woLDnS1q1V3VLm9P","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739379,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":160,"completion_tokens":14,"total_tokens":174,"cost":0.0000408,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000024,"upstream_inference_completions_cost":0.0000168},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -47,15 +47,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 1.651823333s
+    duration: 732.581833ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44411
+    content_length: 44585
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls.yaml 🔗

@@ -24,29 +24,23 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739412-Y09R7myDXdUaQmaPvgvH","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739412,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":"Find"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739412-Y09R7myDXdUaQmaPvgvH","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739412,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":" ."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739412-Y09R7myDXdUaQmaPvgvH","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739412,"choices":[{"index":0,"delta":{"role":"assistant","content":"Find"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739412-Y09R7myDXdUaQmaPvgvH","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739412,"choices":[{"index":0,"delta":{"role":"assistant","content":" .go files and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739412-Y09R7myDXdUaQmaPvgvH","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739412,"choices":[{"index":0,"delta":{"role":"assistant","content":" list directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739412-Y09R7myDXdUaQmaPvgvH","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739412,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":" list"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739412-Y09R7myDXdUaQmaPvgvH","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739412,"choices":[{"index":0,"delta":{"role":"assistant","content":" parallel"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739412-Y09R7myDXdUaQmaPvgvH","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739412,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
 
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":" parallel"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
-
-      data: {"id":"gen-1761569532-BJhKrRGMK0C1QFlSn4Jj","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569532,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":156,"completion_tokens":10,"total_tokens":166,"cost":0.00003284,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00002184,"upstream_inference_completions_cost":0.000011},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739412-Y09R7myDXdUaQmaPvgvH","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739412,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":156,"completion_tokens":10,"total_tokens":166,"cost":0.00003284,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00002184,"upstream_inference_completions_cost":0.000011},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -55,15 +49,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 1.507790333s
+    duration: 561.956875ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44422
+    content_length: 44596
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/read_a_file.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 724
+    content_length: 44469
     host: ""
-    body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n<rules>\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nRead the go mod\n <think>\n\n</think>","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}'

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/simple_test.yaml 🔗

@@ -24,13 +24,15 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761568496-jxAEhovCmjlDi7Et6rOR","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568496,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739318-IdmkJnEu9uY8yYiY9n5i","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739318,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568496-jxAEhovCmjlDi7Et6rOR","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568496,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739318-IdmkJnEu9uY8yYiY9n5i","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739318,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568496-jxAEhovCmjlDi7Et6rOR","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568496,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+      data: {"id":"gen-1761739318-IdmkJnEu9uY8yYiY9n5i","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739318,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761568496-jxAEhovCmjlDi7Et6rOR","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568496,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":128,"completion_tokens":2,"total_tokens":130,"cost":0.0000144,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000128,"upstream_inference_completions_cost":0.0000016},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739318-IdmkJnEu9uY8yYiY9n5i","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739318,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+      data: {"id":"gen-1761739318-IdmkJnEu9uY8yYiY9n5i","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739318,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":128,"completion_tokens":2,"total_tokens":130,"cost":0.00002012,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001792,"upstream_inference_completions_cost":0.0000022},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -39,15 +41,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 1.196754333s
+    duration: 1.246189959s
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44285
+    content_length: 44459
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool.yaml 🔗

@@ -24,21 +24,31 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761569109-EIcI8HTRUgIDlaGUSD6s","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569109,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569109-EIcI8HTRUgIDlaGUSD6s","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569109,"choices":[{"index":0,"delta":{"role":"assistant","content":"Search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":"Search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569109-EIcI8HTRUgIDlaGUSD6s","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569109,"choices":[{"index":0,"delta":{"role":"assistant","content":" for func"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569109-EIcI8HTRUgIDlaGUSD6s","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569109,"choices":[{"index":0,"delta":{"role":"assistant","content":" main in Go repositories"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":" func"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569109-EIcI8HTRUgIDlaGUSD6s","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569109,"choices":[{"index":0,"delta":{"role":"assistant","content":" using Source"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569109-EIcI8HTRUgIDlaGUSD6s","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569109,"choices":[{"index":0,"delta":{"role":"assistant","content":"graph"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569109-EIcI8HTRUgIDlaGUSD6s","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569109,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569109-EIcI8HTRUgIDlaGUSD6s","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569109,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":140,"completion_tokens":11,"total_tokens":151,"cost":0.0000342,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000021,"upstream_inference_completions_cost":0.0000132},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":" repositories"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":" Source"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":"graph"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+      data: {"id":"gen-1761739394-Sje6bTef73gHJt8BJ6QE","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739394,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":140,"completion_tokens":11,"total_tokens":151,"cost":0.0000261,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000014,"upstream_inference_completions_cost":0.0000121},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -47,15 +57,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 515.803333ms
+    duration: 660.816458ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44345
+    content_length: 44519
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/update_a_file.yaml 🔗

@@ -24,27 +24,19 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739329-MncJd5Hu7FuIefPllGvs","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739329,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
 
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":"Update"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739329-MncJd5Hu7FuIefPllGvs","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739329,"choices":[{"index":0,"delta":{"role":"assistant","content":"Update"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
 
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739329-MncJd5Hu7FuIefPllGvs","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739329,"choices":[{"index":0,"delta":{"role":"assistant","content":" main.go to print"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
 
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739329-MncJd5Hu7FuIefPllGvs","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739329,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
 
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739329-MncJd5Hu7FuIefPllGvs","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739329,"choices":[{"index":0,"delta":{"role":"assistant","content":" from crush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
 
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":" print"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739329-MncJd5Hu7FuIefPllGvs","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739329,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":null}
 
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":" from"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":" crush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
-
-      data: {"id":"gen-1761568500-oqG43YqR2HxT6VT2qzEF","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761568500,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":141,"completion_tokens":9,"total_tokens":150,"cost":0.00002964,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001974,"upstream_inference_completions_cost":0.0000099},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739329-MncJd5Hu7FuIefPllGvs","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739329,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":145,"completion_tokens":8,"total_tokens":153,"cost":0.0000885,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000725,"upstream_inference_completions_cost":0.000016},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -53,15 +45,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 633.531417ms
+    duration: 1.927088584s
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44351
+    content_length: 44525
     host: ""

internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/write_tool.yaml 🔗

@@ -24,25 +24,19 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739409-Xr5oIGvyjjbROoGHaNFi","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739409,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739409-Xr5oIGvyjjbROoGHaNFi","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739409,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":" config"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739409-Xr5oIGvyjjbROoGHaNFi","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739409,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":".json"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739409-Xr5oIGvyjjbROoGHaNFi","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739409,"choices":[{"index":0,"delta":{"role":"assistant","content":" config.json with name"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739409-Xr5oIGvyjjbROoGHaNFi","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739409,"choices":[{"index":0,"delta":{"role":"assistant","content":" and version data"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":" sample"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+      data: {"id":"gen-1761739409-Xr5oIGvyjjbROoGHaNFi","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739409,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
 
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":" JSON"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":" content"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
-
-      data: {"id":"gen-1761569138-UOUGJFA8q0l2rD8bYeso","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761569138,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":155,"completion_tokens":8,"total_tokens":163,"cost":0.0000305,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000217,"upstream_inference_completions_cost":0.0000088},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+      data: {"id":"gen-1761739409-Xr5oIGvyjjbROoGHaNFi","provider":"DeepInfra","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761739409,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":155,"completion_tokens":9,"total_tokens":164,"cost":0.0000316,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000217,"upstream_inference_completions_cost":0.0000099},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
       data: [DONE]
 
@@ -51,15 +45,15 @@ interactions:
       - text/event-stream
     status: 200 OK
     code: 200
-    duration: 637.56075ms
+    duration: 249.539125ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44388
+    content_length: 44562
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/bash_tool.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 729
+    content_length: 757
     host: ""
-    body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n<rules>\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''\n <think>\n\n</think>","role":"user"}],"model":"glm-4.5-air","max_tokens":40,"stream_options":{"include_usage":true},"stream":true}'
+    body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n<rules>\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''. do not print its timestamp\n <think>\n\n</think>","role":"user"}],"model":"glm-4.5-air","max_tokens":40,"stream_options":{"include_usage":true},"stream":true}'
     headers:
       Accept:
       - application/json
@@ -24,21 +24,21 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"2025102720501290f33650b2c3470c","created":1761569412,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"20251029200356894bd1a4c4464c46","created":1761739436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"2025102720501290f33650b2c3470c","created":1761569412,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Create"}}]}
+      data: {"id":"20251029200356894bd1a4c4464c46","created":1761739436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Create"}}]}
 
-      data: {"id":"2025102720501290f33650b2c3470c","created":1761569412,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" bash"}}]}
+      data: {"id":"20251029200356894bd1a4c4464c46","created":1761739436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" test"}}]}
 
-      data: {"id":"2025102720501290f33650b2c3470c","created":1761569412,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" file"}}]}
+      data: {"id":"20251029200356894bd1a4c4464c46","created":1761739436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":".txt"}}]}
 
-      data: {"id":"2025102720501290f33650b2c3470c","created":1761569412,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" with"}}]}
+      data: {"id":"20251029200356894bd1a4c4464c46","created":1761739436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" with"}}]}
 
-      data: {"id":"2025102720501290f33650b2c3470c","created":1761569412,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" hello"}}]}
+      data: {"id":"20251029200356894bd1a4c4464c46","created":1761739436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" hello"}}]}
 
-      data: {"id":"2025102720501290f33650b2c3470c","created":1761569412,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" content"}}]}
+      data: {"id":"20251029200356894bd1a4c4464c46","created":1761739436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" bash"}}]}
 
-      data: {"id":"2025102720501290f33650b2c3470c","created":1761569412,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":134,"completion_tokens":10,"total_tokens":144,"prompt_tokens_details":{"cached_tokens":114}}}
+      data: {"id":"20251029200356894bd1a4c4464c46","created":1761739436,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":140,"completion_tokens":10,"total_tokens":150,"prompt_tokens_details":{"cached_tokens":21}}}
 
       data: [DONE]
 
@@ -47,15 +47,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 741.43025ms
+    duration: 740.930958ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44221
+    content_length: 44423
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/download_tool.yaml 🔗

@@ -24,21 +24,19 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"2025102720501608e1f99bc5f94db3","created":1761569416,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"2025102920040009471dbb3c37434e","created":1761739440,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"2025102720501608e1f99bc5f94db3","created":1761569416,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Download"}}]}
+      data: {"id":"2025102920040009471dbb3c37434e","created":1761739440,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Download"}}]}
 
-      data: {"id":"2025102720501608e1f99bc5f94db3","created":1761569416,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" and"}}]}
+      data: {"id":"2025102920040009471dbb3c37434e","created":1761739440,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" example"}}]}
 
-      data: {"id":"2025102720501608e1f99bc5f94db3","created":1761569416,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" save"}}]}
+      data: {"id":"2025102920040009471dbb3c37434e","created":1761739440,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":".txt"}}]}
 
-      data: {"id":"2025102720501608e1f99bc5f94db3","created":1761569416,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" example"}}]}
+      data: {"id":"2025102920040009471dbb3c37434e","created":1761739440,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" from"}}]}
 
-      data: {"id":"2025102720501608e1f99bc5f94db3","created":1761569416,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":".txt"}}]}
+      data: {"id":"2025102920040009471dbb3c37434e","created":1761739440,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" URL"}}]}
 
-      data: {"id":"2025102720501608e1f99bc5f94db3","created":1761569416,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" file"}}]}
-
-      data: {"id":"2025102720501608e1f99bc5f94db3","created":1761569416,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":143,"completion_tokens":10,"total_tokens":153,"prompt_tokens_details":{"cached_tokens":4}}}
+      data: {"id":"2025102920040009471dbb3c37434e","created":1761739440,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":143,"completion_tokens":9,"total_tokens":152,"prompt_tokens_details":{"cached_tokens":114}}}
 
       data: [DONE]
 
@@ -47,15 +45,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 716.340625ms
+    duration: 743.129ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44274
+    content_length: 44448
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/fetch_tool.yaml 🔗

@@ -24,23 +24,17 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"2025102720502156b782519b5040eb","created":1761569421,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"202510292004033e9a51a671454592","created":1761739443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"2025102720502156b782519b5040eb","created":1761569421,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Check"}}]}
+      data: {"id":"202510292004033e9a51a671454592","created":1761739443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Check"}}]}
 
-      data: {"id":"2025102720502156b782519b5040eb","created":1761569421,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" HTML"}}]}
+      data: {"id":"202510292004033e9a51a671454592","created":1761739443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" HTML"}}]}
 
-      data: {"id":"2025102720502156b782519b5040eb","created":1761569421,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" for"}}]}
+      data: {"id":"202510292004033e9a51a671454592","created":1761739443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" for"}}]}
 
-      data: {"id":"2025102720502156b782519b5040eb","created":1761569421,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" '"}}]}
+      data: {"id":"202510292004033e9a51a671454592","created":1761739443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" John Doe"}}]}
 
-      data: {"id":"2025102720502156b782519b5040eb","created":1761569421,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"John"}}]}
-
-      data: {"id":"2025102720502156b782519b5040eb","created":1761569421,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Doe"}}]}
-
-      data: {"id":"2025102720502156b782519b5040eb","created":1761569421,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"'"}}]}
-
-      data: {"id":"2025102720502156b782519b5040eb","created":1761569421,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":148,"completion_tokens":11,"total_tokens":159,"prompt_tokens_details":{"cached_tokens":22}}}
+      data: {"id":"202510292004033e9a51a671454592","created":1761739443,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":148,"completion_tokens":9,"total_tokens":157,"prompt_tokens_details":{"cached_tokens":4}}}
 
       data: [DONE]
 
@@ -49,15 +43,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 678.926875ms
+    duration: 792.712834ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44292
+    content_length: 44466
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/glob_tool.yaml 🔗

@@ -24,19 +24,21 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"20251027205025492b71cfe2ba4b8f","created":1761569425,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"20251029200411fd81181f53354f03","created":1761739451,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"20251027205025492b71cfe2ba4b8f","created":1761569425,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Find"}}]}
+      data: {"id":"20251029200411fd81181f53354f03","created":1761739451,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Find"}}]}
 
-      data: {"id":"20251027205025492b71cfe2ba4b8f","created":1761569425,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Go"}}]}
+      data: {"id":"20251029200411fd81181f53354f03","created":1761739451,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" all"}}]}
 
-      data: {"id":"20251027205025492b71cfe2ba4b8f","created":1761569425,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" files"}}]}
+      data: {"id":"20251029200411fd81181f53354f03","created":1761739451,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Go"}}]}
 
-      data: {"id":"20251027205025492b71cfe2ba4b8f","created":1761569425,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" with"}}]}
+      data: {"id":"20251029200411fd81181f53354f03","created":1761739451,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" files"}}]}
 
-      data: {"id":"20251027205025492b71cfe2ba4b8f","created":1761569425,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" glob"}}]}
+      data: {"id":"20251029200411fd81181f53354f03","created":1761739451,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" with"}}]}
 
-      data: {"id":"20251027205025492b71cfe2ba4b8f","created":1761569425,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":132,"completion_tokens":9,"total_tokens":141,"prompt_tokens_details":{"cached_tokens":22}}}
+      data: {"id":"20251029200411fd81181f53354f03","created":1761739451,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" glob"}}]}
+
+      data: {"id":"20251029200411fd81181f53354f03","created":1761739451,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":132,"completion_tokens":10,"total_tokens":142,"prompt_tokens_details":{"cached_tokens":115}}}
 
       data: [DONE]
 
@@ -45,15 +47,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 584.032791ms
+    duration: 846.707459ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44210
+    content_length: 44384
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/grep_tool.yaml 🔗

@@ -24,17 +24,17 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"20251027205029e5e7d6f4bced48d2","created":1761569430,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"20251029200416d739eb7454db496d","created":1761739456,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"20251027205029e5e7d6f4bced48d2","created":1761569430,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"grep"}}]}
+      data: {"id":"20251029200416d739eb7454db496d","created":1761739456,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"grep"}}]}
 
-      data: {"id":"20251027205029e5e7d6f4bced48d2","created":1761569430,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" package"}}]}
+      data: {"id":"20251029200416d739eb7454db496d","created":1761739456,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" package"}}]}
 
-      data: {"id":"20251027205029e5e7d6f4bced48d2","created":1761569430,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" go"}}]}
+      data: {"id":"20251029200416d739eb7454db496d","created":1761739456,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" go"}}]}
 
-      data: {"id":"20251027205029e5e7d6f4bced48d2","created":1761569430,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" files"}}]}
+      data: {"id":"20251029200416d739eb7454db496d","created":1761739456,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" files"}}]}
 
-      data: {"id":"20251027205029e5e7d6f4bced48d2","created":1761569430,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":133,"completion_tokens":8,"total_tokens":141,"prompt_tokens_details":{"cached_tokens":4}}}
+      data: {"id":"20251029200416d739eb7454db496d","created":1761739456,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":133,"completion_tokens":8,"total_tokens":141,"prompt_tokens_details":{"cached_tokens":114}}}
 
       data: [DONE]
 
@@ -43,15 +43,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 592.670875ms
+    duration: 1.200410625s
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44208
+    content_length: 44382
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/ls_tool.yaml 🔗

@@ -24,19 +24,19 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"2025102720503367476e2233674d0c","created":1761569433,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"2025102920042291a8037739ca4770","created":1761739462,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"2025102720503367476e2233674d0c","created":1761569433,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"List"}}]}
+      data: {"id":"2025102920042291a8037739ca4770","created":1761739462,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"List"}}]}
 
-      data: {"id":"2025102720503367476e2233674d0c","created":1761569433,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" files"}}]}
+      data: {"id":"2025102920042291a8037739ca4770","created":1761739462,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" files"}}]}
 
-      data: {"id":"2025102720503367476e2233674d0c","created":1761569433,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" with"}}]}
+      data: {"id":"2025102920042291a8037739ca4770","created":1761739462,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" with"}}]}
 
-      data: {"id":"2025102720503367476e2233674d0c","created":1761569433,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" ls"}}]}
+      data: {"id":"2025102920042291a8037739ca4770","created":1761739462,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" ls"}}]}
 
-      data: {"id":"2025102720503367476e2233674d0c","created":1761569433,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" command"}}]}
+      data: {"id":"2025102920042291a8037739ca4770","created":1761739462,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" command"}}]}
 
-      data: {"id":"2025102720503367476e2233674d0c","created":1761569433,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":130,"completion_tokens":9,"total_tokens":139,"prompt_tokens_details":{"cached_tokens":4}}}
+      data: {"id":"2025102920042291a8037739ca4770","created":1761739462,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":130,"completion_tokens":9,"total_tokens":139,"prompt_tokens_details":{"cached_tokens":115}}}
 
       data: [DONE]
 
@@ -45,15 +45,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 651.609917ms
+    duration: 741.087417ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44202
+    content_length: 44376
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/multiedit_tool.yaml 🔗

@@ -24,21 +24,25 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"2025102720503657170e9c8cbd43dc","created":1761569436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"2025102720503657170e9c8cbd43dc","created":1761569436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Mult"}}]}
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Mult"}}]}
 
-      data: {"id":"2025102720503657170e9c8cbd43dc","created":1761569436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"ied"}}]}
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"ied"}}]}
 
-      data: {"id":"2025102720503657170e9c8cbd43dc","created":1761569436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"it"}}]}
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"it"}}]}
 
-      data: {"id":"2025102720503657170e9c8cbd43dc","created":1761569436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Go"}}]}
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" main"}}]}
 
-      data: {"id":"2025102720503657170e9c8cbd43dc","created":1761569436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Code"}}]}
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":".go"}}]}
 
-      data: {"id":"2025102720503657170e9c8cbd43dc","created":1761569436,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Modification"}}]}
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" changes"}}]}
 
-      data: {"id":"2025102720503657170e9c8cbd43dc","created":1761569436,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":153,"completion_tokens":10,"total_tokens":163,"prompt_tokens_details":{"cached_tokens":4}}}
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" and"}}]}
+
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" comment"}}]}
+
+      data: {"id":"202510292004259eac19652f9f410e","created":1761739465,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":153,"completion_tokens":12,"total_tokens":165,"prompt_tokens_details":{"cached_tokens":114}}}
 
       data: [DONE]
 
@@ -47,15 +51,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 594.973125ms
+    duration: 663.65375ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44288
+    content_length: 44462
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/parallel_tool_calls.yaml 🔗

@@ -6,9 +6,9 @@ interactions:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 797
+    content_length: 44473
     host: ""
-    body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n<rules>\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n</rules>\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\n <think>\n\n</think>","role":"user"}],"model":"glm-4.5-air","max_tokens":40,"stream_options":{"include_usage":true},"stream":true}'

internal/agent/testdata/TestCoderAgent/zai-glm4.6/read_a_file.yaml 🔗

@@ -24,15 +24,15 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"20251027204955d48a37603ec04109","created":1761569395,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"2025102920034011a5ceffa9294139","created":1761739420,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"20251027204955d48a37603ec04109","created":1761569395,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Go"}}]}
+      data: {"id":"2025102920034011a5ceffa9294139","created":1761739420,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Go"}}]}
 
-      data: {"id":"20251027204955d48a37603ec04109","created":1761569395,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" mod"}}]}
+      data: {"id":"2025102920034011a5ceffa9294139","created":1761739420,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Module"}}]}
 
-      data: {"id":"20251027204955d48a37603ec04109","created":1761569395,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" content"}}]}
+      data: {"id":"2025102920034011a5ceffa9294139","created":1761739420,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Instructions"}}]}
 
-      data: {"id":"20251027204955d48a37603ec04109","created":1761569395,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":124,"completion_tokens":7,"total_tokens":131,"prompt_tokens_details":{"cached_tokens":4}}}
+      data: {"id":"2025102920034011a5ceffa9294139","created":1761739420,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":124,"completion_tokens":7,"total_tokens":131,"prompt_tokens_details":{"cached_tokens":4}}}
 
       data: [DONE]
 
@@ -41,15 +41,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 586.295459ms
+    duration: 937.205417ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44172
+    content_length: 44346
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/simple_test.yaml 🔗

@@ -24,13 +24,13 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"2025102720495318d6029e0f5d4e8e","created":1761569393,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"202510292003376739b0e60ce941f9","created":1761739417,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"2025102720495318d6029e0f5d4e8e","created":1761569393,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Simple"}}]}
+      data: {"id":"202510292003376739b0e60ce941f9","created":1761739417,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"G"}}]}
 
-      data: {"id":"2025102720495318d6029e0f5d4e8e","created":1761569393,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" greeting"}}]}
+      data: {"id":"202510292003376739b0e60ce941f9","created":1761739417,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"reeting"}}]}
 
-      data: {"id":"2025102720495318d6029e0f5d4e8e","created":1761569393,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":121,"completion_tokens":6,"total_tokens":127,"prompt_tokens_details":{"cached_tokens":22}}}
+      data: {"id":"202510292003376739b0e60ce941f9","created":1761739417,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":121,"completion_tokens":6,"total_tokens":127,"prompt_tokens_details":{"cached_tokens":4}}}
 
       data: [DONE]
 
@@ -39,15 +39,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 1.6131245s
+    duration: 2.487319667s
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44162
+    content_length: 44336
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/sourcegraph_tool.yaml 🔗

@@ -24,21 +24,21 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"20251027205043a4b6149f14264e9a","created":1761569443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"20251029200447164db4e5a2864767","created":1761739487,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"20251027205043a4b6149f14264e9a","created":1761569443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Source"}}]}
+      data: {"id":"20251029200447164db4e5a2864767","created":1761739487,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Search"}}]}
 
-      data: {"id":"20251027205043a4b6149f14264e9a","created":1761569443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"graph"}}]}
+      data: {"id":"20251029200447164db4e5a2864767","created":1761739487,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" for"}}]}
 
-      data: {"id":"20251027205043a4b6149f14264e9a","created":1761569443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Go"}}]}
+      data: {"id":"20251029200447164db4e5a2864767","created":1761739487,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" func"}}]}
 
-      data: {"id":"20251027205043a4b6149f14264e9a","created":1761569443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" main"}}]}
+      data: {"id":"20251029200447164db4e5a2864767","created":1761739487,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" main"}}]}
 
-      data: {"id":"20251027205043a4b6149f14264e9a","created":1761569443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" function"}}]}
+      data: {"id":"20251029200447164db4e5a2864767","created":1761739487,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" in"}}]}
 
-      data: {"id":"20251027205043a4b6149f14264e9a","created":1761569443,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" search"}}]}
+      data: {"id":"20251029200447164db4e5a2864767","created":1761739487,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" Go"}}]}
 
-      data: {"id":"20251027205043a4b6149f14264e9a","created":1761569443,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":133,"completion_tokens":10,"total_tokens":143,"prompt_tokens_details":{"cached_tokens":114}}}
+      data: {"id":"20251029200447164db4e5a2864767","created":1761739487,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":133,"completion_tokens":10,"total_tokens":143,"prompt_tokens_details":{"cached_tokens":115}}}
 
       data: [DONE]
 
@@ -47,15 +47,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 677.8505ms
+    duration: 756.125875ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44222
+    content_length: 44396
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/update_a_file.yaml 🔗

@@ -24,23 +24,23 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"202510272050027d15b1bf6019492e","created":1761569402,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"202510292003484ef425e7627b4601","created":1761739428,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"202510272050027d15b1bf6019492e","created":1761569402,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Update"}}]}
+      data: {"id":"202510292003484ef425e7627b4601","created":1761739428,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Update"}}]}
 
-      data: {"id":"202510272050027d15b1bf6019492e","created":1761569402,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" main"}}]}
+      data: {"id":"202510292003484ef425e7627b4601","created":1761739428,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" main"}}]}
 
-      data: {"id":"202510272050027d15b1bf6019492e","created":1761569402,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":".go"}}]}
+      data: {"id":"202510292003484ef425e7627b4601","created":1761739428,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":".go"}}]}
 
-      data: {"id":"202510272050027d15b1bf6019492e","created":1761569402,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" to"}}]}
+      data: {"id":"202510292003484ef425e7627b4601","created":1761739428,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" with"}}]}
 
-      data: {"id":"202510272050027d15b1bf6019492e","created":1761569402,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" print"}}]}
+      data: {"id":"202510292003484ef425e7627b4601","created":1761739428,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" crush"}}]}
 
-      data: {"id":"202510272050027d15b1bf6019492e","created":1761569402,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" hello"}}]}
+      data: {"id":"202510292003484ef425e7627b4601","created":1761739428,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" hello"}}]}
 
-      data: {"id":"202510272050027d15b1bf6019492e","created":1761569402,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" message"}}]}
+      data: {"id":"202510292003484ef425e7627b4601","created":1761739428,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" message"}}]}
 
-      data: {"id":"202510272050027d15b1bf6019492e","created":1761569402,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":134,"completion_tokens":11,"total_tokens":145,"prompt_tokens_details":{"cached_tokens":4}}}
+      data: {"id":"202510292003484ef425e7627b4601","created":1761739428,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":134,"completion_tokens":11,"total_tokens":145,"prompt_tokens_details":{"cached_tokens":4}}}
 
       data: [DONE]
 
@@ -49,15 +49,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 880.1925ms
+    duration: 626.21525ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44228
+    content_length: 44402
     host: ""

internal/agent/testdata/TestCoderAgent/zai-glm4.6/write_tool.yaml 🔗

@@ -24,21 +24,21 @@ interactions:
     proto_minor: 0
     content_length: -1
     body: |+
-      data: {"id":"20251027205048e41cb9d9ad4d40ad","created":1761569448,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
+      data: {"id":"202510292004575c0d2dedae6b4990","created":1761739497,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"\n"}}]}
 
-      data: {"id":"20251027205048e41cb9d9ad4d40ad","created":1761569448,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Create"}}]}
+      data: {"id":"202510292004575c0d2dedae6b4990","created":1761739497,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":"Create"}}]}
 
-      data: {"id":"20251027205048e41cb9d9ad4d40ad","created":1761569448,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" config"}}]}
+      data: {"id":"202510292004575c0d2dedae6b4990","created":1761739497,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" config"}}]}
 
-      data: {"id":"20251027205048e41cb9d9ad4d40ad","created":1761569448,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":".json"}}]}
+      data: {"id":"202510292004575c0d2dedae6b4990","created":1761739497,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":".json"}}]}
 
-      data: {"id":"20251027205048e41cb9d9ad4d40ad","created":1761569448,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" with"}}]}
+      data: {"id":"202510292004575c0d2dedae6b4990","created":1761739497,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" with"}}]}
 
-      data: {"id":"20251027205048e41cb9d9ad4d40ad","created":1761569448,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" test"}}]}
+      data: {"id":"202510292004575c0d2dedae6b4990","created":1761739497,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" write"}}]}
 
-      data: {"id":"20251027205048e41cb9d9ad4d40ad","created":1761569448,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" version"}}]}
+      data: {"id":"202510292004575c0d2dedae6b4990","created":1761739497,"model":"glm-4.5-air","choices":[{"index":0,"delta":{"role":"assistant","content":" command"}}]}
 
-      data: {"id":"20251027205048e41cb9d9ad4d40ad","created":1761569448,"model":"glm-4.5-air","choices":[{"index":1,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":148,"completion_tokens":10,"total_tokens":158,"prompt_tokens_details":{"cached_tokens":4}}}
+      data: {"id":"202510292004575c0d2dedae6b4990","created":1761739497,"model":"glm-4.5-air","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":148,"completion_tokens":10,"total_tokens":158,"prompt_tokens_details":{"cached_tokens":115}}}
 
       data: [DONE]
 
@@ -47,15 +47,15 @@ interactions:
       - text/event-stream;charset=UTF-8
     status: 200 OK
     code: 200
-    duration: 600.723792ms
+    duration: 738.070334ms
 - id: 1
   request:
     proto: HTTP/1.1
     proto_major: 1
     proto_minor: 1
-    content_length: 44265
+    content_length: 44439
     host: ""

internal/agent/tools/download.go 🔗

@@ -1,6 +1,7 @@
 package tools
 
 import (
+	"cmp"
 	"context"
 	_ "embed"
 	"fmt"
@@ -61,6 +62,8 @@ func NewDownloadTool(permissions permission.Service, workingDir string, client *
 			}
 
 			filePath := filepathext.SmartJoin(workingDir, params.FilePath)
+			relPath, _ := filepath.Rel(workingDir, filePath)
+			relPath = filepath.ToSlash(cmp.Or(relPath, filePath))
 
 			sessionID := GetSessionFromContext(ctx)
 			if sessionID == "" {
@@ -144,7 +147,7 @@ func NewDownloadTool(permissions permission.Service, workingDir string, client *
 			}
 
 			contentType := resp.Header.Get("Content-Type")
-			responseMsg := fmt.Sprintf("Successfully downloaded %d bytes to %s", bytesWritten, filePath)
+			responseMsg := fmt.Sprintf("Successfully downloaded %d bytes to %s", bytesWritten, relPath)
 			if contentType != "" {
 				responseMsg += fmt.Sprintf(" (Content-Type: %s)", contentType)
 			}

internal/agent/tools/multiedit.go 🔗

@@ -37,12 +37,19 @@ type MultiEditPermissionsParams struct {
 	NewContent string `json:"new_content,omitempty"`
 }
 
+type FailedEdit struct {
+	Index int                `json:"index"`
+	Error string             `json:"error"`
+	Edit  MultiEditOperation `json:"edit"`
+}
+
 type MultiEditResponseMetadata struct {
-	Additions    int    `json:"additions"`
-	Removals     int    `json:"removals"`
-	OldContent   string `json:"old_content,omitempty"`
-	NewContent   string `json:"new_content,omitempty"`
-	EditsApplied int    `json:"edits_applied"`
+	Additions    int          `json:"additions"`
+	Removals     int          `json:"removals"`
+	OldContent   string       `json:"old_content,omitempty"`
+	NewContent   string       `json:"new_content,omitempty"`
+	EditsApplied int          `json:"edits_applied"`
+	EditsFailed  []FailedEdit `json:"edits_failed,omitempty"`
 }
 
 const MultiEditToolName = "multiedit"
@@ -102,9 +109,6 @@ func NewMultiEditTool(lspClients *csync.Map[string, *lsp.Client], permissions pe
 
 func validateEdits(edits []MultiEditOperation) error {
 	for i, edit := range edits {
-		if edit.OldString == edit.NewString {
-			return fmt.Errorf("edit %d: old_string and new_string are identical", i+1)
-		}
 		// Only the first edit can have empty old_string (for file creation)
 		if i > 0 && edit.OldString == "" {
 			return fmt.Errorf("edit %d: only the first edit can have empty old_string (for file creation)", i+1)
@@ -136,12 +140,18 @@ func processMultiEditWithCreation(edit editContext, params MultiEditParams, call
 	// Start with the content from the first edit
 	currentContent := firstEdit.NewString
 
-	// Apply remaining edits to the content
+	// Apply remaining edits to the content, tracking failures
+	var failedEdits []FailedEdit
 	for i := 1; i < len(params.Edits); i++ {
 		edit := params.Edits[i]
 		newContent, err := applyEditToContent(currentContent, edit)
 		if err != nil {
-			return fantasy.NewTextErrorResponse(fmt.Sprintf("edit %d failed: %s", i+1, err.Error())), nil
+			failedEdits = append(failedEdits, FailedEdit{
+				Index: i + 1,
+				Error: err.Error(),
+				Edit:  edit,
+			})
+			continue
 		}
 		currentContent = newContent
 	}
@@ -192,14 +202,23 @@ func processMultiEditWithCreation(edit editContext, params MultiEditParams, call
 	recordFileWrite(params.FilePath)
 	recordFileRead(params.FilePath)
 
+	editsApplied := len(params.Edits) - len(failedEdits)
+	var message string
+	if len(failedEdits) > 0 {
+		message = fmt.Sprintf("File created with %d of %d edits: %s (%d edit(s) failed)", editsApplied, len(params.Edits), params.FilePath, len(failedEdits))
+	} else {
+		message = fmt.Sprintf("File created with %d edits: %s", len(params.Edits), params.FilePath)
+	}
+
 	return fantasy.WithResponseMetadata(
-		fantasy.NewTextResponse(fmt.Sprintf("File created with %d edits: %s", len(params.Edits), params.FilePath)),
+		fantasy.NewTextResponse(message),
 		MultiEditResponseMetadata{
 			OldContent:   "",
 			NewContent:   currentContent,
 			Additions:    additions,
 			Removals:     removals,
-			EditsApplied: len(params.Edits),
+			EditsApplied: editsApplied,
+			EditsFailed:  failedEdits,
 		},
 	), nil
 }
@@ -242,17 +261,33 @@ func processMultiEditExistingFile(edit editContext, params MultiEditParams, call
 	oldContent, isCrlf := fsext.ToUnixLineEndings(string(content))
 	currentContent := oldContent
 
-	// Apply all edits sequentially
+	// Apply all edits sequentially, tracking failures
+	var failedEdits []FailedEdit
 	for i, edit := range params.Edits {
 		newContent, err := applyEditToContent(currentContent, edit)
 		if err != nil {
-			return fantasy.NewTextErrorResponse(fmt.Sprintf("edit %d failed: %s", i+1, err.Error())), nil
+			failedEdits = append(failedEdits, FailedEdit{
+				Index: i + 1,
+				Error: err.Error(),
+				Edit:  edit,
+			})
+			continue
 		}
 		currentContent = newContent
 	}
 
 	// Check if content actually changed
 	if oldContent == currentContent {
+		// If we have failed edits, report them
+		if len(failedEdits) > 0 {
+			return fantasy.WithResponseMetadata(
+				fantasy.NewTextErrorResponse(fmt.Sprintf("no changes made - all %d edit(s) failed", len(failedEdits))),
+				MultiEditResponseMetadata{
+					EditsApplied: 0,
+					EditsFailed:  failedEdits,
+				},
+			), nil
+		}
 		return fantasy.NewTextErrorResponse("no changes made - all edits resulted in identical content"), nil
 	}
 
@@ -316,14 +351,23 @@ func processMultiEditExistingFile(edit editContext, params MultiEditParams, call
 	recordFileWrite(params.FilePath)
 	recordFileRead(params.FilePath)
 
+	editsApplied := len(params.Edits) - len(failedEdits)
+	var message string
+	if len(failedEdits) > 0 {
+		message = fmt.Sprintf("Applied %d of %d edits to file: %s (%d edit(s) failed)", editsApplied, len(params.Edits), params.FilePath, len(failedEdits))
+	} else {
+		message = fmt.Sprintf("Applied %d edits to file: %s", len(params.Edits), params.FilePath)
+	}
+
 	return fantasy.WithResponseMetadata(
-		fantasy.NewTextResponse(fmt.Sprintf("Applied %d edits to file: %s", len(params.Edits), params.FilePath)),
+		fantasy.NewTextResponse(message),
 		MultiEditResponseMetadata{
 			OldContent:   oldContent,
 			NewContent:   currentContent,
 			Additions:    additions,
 			Removals:     removals,
-			EditsApplied: len(params.Edits),
+			EditsApplied: editsApplied,
+			EditsFailed:  failedEdits,
 		},
 	), nil
 }

internal/agent/tools/multiedit.md 🔗

@@ -17,7 +17,8 @@ Makes multiple edits to a single file in one operation. Built on Edit tool for e
 <operation>
 - Edits applied sequentially in provided order.
 - Each edit operates on result of previous edit.
-- ATOMIC: If any single edit fails, the entire operation fails and no changes are applied.
+- PARTIAL SUCCESS: If some edits fail, successful edits are still applied. Failed edits are returned in the response.
+- File is modified if at least one edit succeeds.
 - Ideal for several changes to different parts of same file.
 </operation>
 
@@ -31,9 +32,10 @@ Use the same level of precision as Edit. Multiedit often fails due to formatting
 
 <critical_requirements>
 1. Apply Edit tool rules to EACH edit (see edit.md).
-2. Edits are atomic—either all succeed or none are applied.
+2. Edits are applied in order; successful edits are kept even if later edits fail.
 3. Plan sequence carefully: earlier edits change the file content that later edits must match.
 4. Ensure each old_string is unique at its application time (after prior edits).
+5. Check the response for failed edits and retry them if needed.
 </critical_requirements>
 
 <verification_before_using>
@@ -45,26 +47,27 @@ Use the same level of precision as Edit. Multiedit often fails due to formatting
 </verification_before_using>
 
 <warnings>
-- Operation fails if any old_string doesn’t match exactly (including whitespace) or equals new_string.
+- Operation continues even if some edits fail; check response for failed edits.
 - Earlier edits can invalidate later matches (added/removed spaces, lines, or reordered text).
 - Mixed tabs/spaces, trailing spaces, or missing blank lines commonly cause failures.
 - replace_all may affect unintended regions—use carefully or provide more context.
 </warnings>
 
 <recovery_steps>
-If the operation fails:
-1. Identify the first failing edit (start from top; test subsets to isolate).
-2. View the file again and copy more surrounding context for that edit.
-3. Recalculate later old_string values based on the file state AFTER preceding edits.
-4. Reduce the batch (apply earlier stable edits first), then follow up with the rest.
+If some edits fail:
+1. Check the response metadata for the list of failed edits with their error messages.
+2. View the file again to see the current state after successful edits.
+3. Adjust the failed edits based on the new file content.
+4. Retry the failed edits with corrected old_string values.
+5. Consider breaking complex batches into smaller, independent operations.
 </recovery_steps>
 
 <best_practices>
-- Ensure all edits result in correct, idiomatic code; don’t leave code broken.
+- Ensure all edits result in correct, idiomatic code; don't leave code broken.
 - Use absolute file paths (starting with /).
-- Use replace_all only when you’re certain; otherwise provide unique context.
+- Use replace_all only when you're certain; otherwise provide unique context.
 - Match existing style exactly (spaces, tabs, blank lines).
-- Test after the operation; if it fails, fix and retry in smaller chunks.
+- Review failed edits in the response and retry with corrections.
 </best_practices>
 
 <whitespace_checklist>
@@ -109,4 +112,14 @@ edits: [
   },
 ]
 ```
+
+✅ Correct: Handling partial success
+
+```
+// If edit 2 fails, edit 1 is still applied
+// Response will indicate:
+// - edits_applied: 1
+// - edits_failed: [{index: 2, error: "...", edit: {...}}]
+// You can then retry edit 2 with corrected context
+```
 </examples>

internal/agent/tools/multiedit_test.go 🔗

@@ -0,0 +1,225 @@
+package tools
+
+import (
+	"context"
+	"os"
+	"path/filepath"
+	"testing"
+
+	"github.com/charmbracelet/crush/internal/csync"
+	"github.com/charmbracelet/crush/internal/history"
+	"github.com/charmbracelet/crush/internal/lsp"
+	"github.com/charmbracelet/crush/internal/permission"
+	"github.com/charmbracelet/crush/internal/pubsub"
+	"github.com/stretchr/testify/require"
+)
+
+type mockPermissionService struct {
+	*pubsub.Broker[permission.PermissionRequest]
+}
+
+func (m *mockPermissionService) Request(req permission.CreatePermissionRequest) bool {
+	return true
+}
+
+func (m *mockPermissionService) Grant(req permission.PermissionRequest) {}
+
+func (m *mockPermissionService) Deny(req permission.PermissionRequest) {}
+
+func (m *mockPermissionService) GrantPersistent(req permission.PermissionRequest) {}
+
+func (m *mockPermissionService) AutoApproveSession(sessionID string) {}
+
+func (m *mockPermissionService) SetSkipRequests(skip bool) {}
+
+func (m *mockPermissionService) SkipRequests() bool {
+	return false
+}
+
+func (m *mockPermissionService) SubscribeNotifications(ctx context.Context) <-chan pubsub.Event[permission.PermissionNotification] {
+	return make(<-chan pubsub.Event[permission.PermissionNotification])
+}
+
+type mockHistoryService struct {
+	*pubsub.Broker[history.File]
+}
+
+func (m *mockHistoryService) Create(ctx context.Context, sessionID, path, content string) (history.File, error) {
+	return history.File{Path: path, Content: content}, nil
+}
+
+func (m *mockHistoryService) CreateVersion(ctx context.Context, sessionID, path, content string) (history.File, error) {
+	return history.File{}, nil
+}
+
+func (m *mockHistoryService) GetByPathAndSession(ctx context.Context, path, sessionID string) (history.File, error) {
+	return history.File{Path: path, Content: ""}, nil
+}
+
+func (m *mockHistoryService) Get(ctx context.Context, id string) (history.File, error) {
+	return history.File{}, nil
+}
+
+func (m *mockHistoryService) ListBySession(ctx context.Context, sessionID string) ([]history.File, error) {
+	return nil, nil
+}
+
+func (m *mockHistoryService) ListLatestSessionFiles(ctx context.Context, sessionID string) ([]history.File, error) {
+	return nil, nil
+}
+
+func (m *mockHistoryService) Delete(ctx context.Context, id string) error {
+	return nil
+}
+
+func (m *mockHistoryService) DeleteSessionFiles(ctx context.Context, sessionID string) error {
+	return nil
+}
+
+func TestApplyEditToContentPartialSuccess(t *testing.T) {
+	t.Parallel()
+
+	content := "line 1\nline 2\nline 3\n"
+
+	// Test successful edit.
+	newContent, err := applyEditToContent(content, MultiEditOperation{
+		OldString: "line 1",
+		NewString: "LINE 1",
+	})
+	require.NoError(t, err)
+	require.Contains(t, newContent, "LINE 1")
+	require.Contains(t, newContent, "line 2")
+
+	// Test failed edit (string not found).
+	_, err = applyEditToContent(content, MultiEditOperation{
+		OldString: "line 99",
+		NewString: "LINE 99",
+	})
+	require.Error(t, err)
+	require.Contains(t, err.Error(), "not found")
+}
+
+func TestMultiEditSequentialApplication(t *testing.T) {
+	t.Parallel()
+
+	tmpDir := t.TempDir()
+	testFile := filepath.Join(tmpDir, "test.txt")
+
+	// Create test file.
+	content := "line 1\nline 2\nline 3\nline 4\n"
+	err := os.WriteFile(testFile, []byte(content), 0o644)
+	require.NoError(t, err)
+
+	// Mock components.
+	lspClients := csync.NewMap[string, *lsp.Client]()
+	permissions := &mockPermissionService{Broker: pubsub.NewBroker[permission.PermissionRequest]()}
+	files := &mockHistoryService{Broker: pubsub.NewBroker[history.File]()}
+
+	// Create multiedit tool.
+	_ = NewMultiEditTool(lspClients, permissions, files, tmpDir)
+
+	// Simulate reading the file first.
+	recordFileRead(testFile)
+
+	// Manually test the sequential application logic.
+	currentContent := content
+
+	// Apply edits sequentially, tracking failures.
+	edits := []MultiEditOperation{
+		{OldString: "line 1", NewString: "LINE 1"},   // Should succeed
+		{OldString: "line 99", NewString: "LINE 99"}, // Should fail - doesn't exist
+		{OldString: "line 3", NewString: "LINE 3"},   // Should succeed
+		{OldString: "line 2", NewString: "LINE 2"},   // Should succeed - still exists
+	}
+
+	var failedEdits []FailedEdit
+	successCount := 0
+
+	for i, edit := range edits {
+		newContent, err := applyEditToContent(currentContent, edit)
+		if err != nil {
+			failedEdits = append(failedEdits, FailedEdit{
+				Index: i + 1,
+				Error: err.Error(),
+				Edit:  edit,
+			})
+			continue
+		}
+		currentContent = newContent
+		successCount++
+	}
+
+	// Verify results.
+	require.Equal(t, 3, successCount, "Expected 3 successful edits")
+	require.Len(t, failedEdits, 1, "Expected 1 failed edit")
+
+	// Check failed edit details.
+	require.Equal(t, 2, failedEdits[0].Index)
+	require.Contains(t, failedEdits[0].Error, "not found")
+
+	// Verify content changes.
+	require.Contains(t, currentContent, "LINE 1")
+	require.Contains(t, currentContent, "LINE 2")
+	require.Contains(t, currentContent, "LINE 3")
+	require.Contains(t, currentContent, "line 4") // Original unchanged
+	require.NotContains(t, currentContent, "LINE 99")
+}
+
+func TestMultiEditAllEditsSucceed(t *testing.T) {
+	t.Parallel()
+
+	content := "line 1\nline 2\nline 3\n"
+
+	edits := []MultiEditOperation{
+		{OldString: "line 1", NewString: "LINE 1"},
+		{OldString: "line 2", NewString: "LINE 2"},
+		{OldString: "line 3", NewString: "LINE 3"},
+	}
+
+	currentContent := content
+	successCount := 0
+
+	for _, edit := range edits {
+		newContent, err := applyEditToContent(currentContent, edit)
+		if err != nil {
+			t.Fatalf("Unexpected error: %v", err)
+		}
+		currentContent = newContent
+		successCount++
+	}
+
+	require.Equal(t, 3, successCount)
+	require.Contains(t, currentContent, "LINE 1")
+	require.Contains(t, currentContent, "LINE 2")
+	require.Contains(t, currentContent, "LINE 3")
+}
+
+func TestMultiEditAllEditsFail(t *testing.T) {
+	t.Parallel()
+
+	content := "line 1\nline 2\n"
+
+	edits := []MultiEditOperation{
+		{OldString: "line 99", NewString: "LINE 99"},
+		{OldString: "line 100", NewString: "LINE 100"},
+	}
+
+	currentContent := content
+	var failedEdits []FailedEdit
+
+	for i, edit := range edits {
+		newContent, err := applyEditToContent(currentContent, edit)
+		if err != nil {
+			failedEdits = append(failedEdits, FailedEdit{
+				Index: i + 1,
+				Error: err.Error(),
+				Edit:  edit,
+			})
+			continue
+		}
+		currentContent = newContent
+	}
+
+	require.Len(t, failedEdits, 2)
+	require.Equal(t, content, currentContent, "Content should be unchanged")
+}

internal/cmd/root.go 🔗

@@ -10,6 +10,7 @@ import (
 	"os"
 	"path/filepath"
 	"strconv"
+	"strings"
 
 	tea "github.com/charmbracelet/bubbletea/v2"
 	"github.com/charmbracelet/colorprofile"
@@ -23,6 +24,7 @@ import (
 	"github.com/charmbracelet/crush/internal/version"
 	"github.com/charmbracelet/fang"
 	"github.com/charmbracelet/lipgloss/v2"
+	uv "github.com/charmbracelet/ultraviolet"
 	"github.com/charmbracelet/x/exp/charmtone"
 	"github.com/charmbracelet/x/term"
 	"github.com/spf13/cobra"
@@ -83,11 +85,13 @@ crush -y
 		event.AppInitialized()
 
 		// Set up the TUI.
-		// ui := tui.New(app)
+		var env uv.Environ = os.Environ()
 		com := common.DefaultCommon(app.Config())
 		ui := ui.New(com, app)
+		ui.QueryVersion = shouldQueryTerminalVersion(env)
 		program := tea.NewProgram(
 			ui,
+			tea.WithEnvironment(env),
 			tea.WithContext(cmd.Context()),
 			tea.WithFilter(tui.MouseEventFilter)) // Filter mouse events based on focus state
 
@@ -255,3 +259,17 @@ func createDotCrushDir(dir string) error {
 
 	return nil
 }
+
+func shouldQueryTerminalVersion(env uv.Environ) bool {
+	termType := env.Getenv("TERM")
+	termProg, okTermProg := env.LookupEnv("TERM_PROGRAM")
+	_, okSSHTTY := env.LookupEnv("SSH_TTY")
+	return (!okTermProg && !okSSHTTY) ||
+		(!strings.Contains(termProg, "Apple") && !okSSHTTY) ||
+		// Terminals that do support XTVERSION.
+		strings.Contains(termType, "ghostty") ||
+		strings.Contains(termType, "wezterm") ||
+		strings.Contains(termType, "alacritty") ||
+		strings.Contains(termType, "kitty") ||
+		strings.Contains(termType, "rio")
+}

internal/config/config.go 🔗

@@ -546,7 +546,7 @@ func (c *ProviderConfig) TestConnection(resolver VariableResolver) error {
 	headers := make(map[string]string)
 	apiKey, _ := resolver.ResolveValue(c.APIKey)
 	switch c.Type {
-	case catwalk.TypeOpenAI, catwalk.TypeOpenAICompat:
+	case catwalk.TypeOpenAI, catwalk.TypeOpenAICompat, catwalk.TypeOpenRouter:
 		baseURL, _ := resolver.ResolveValue(c.BaseURL)
 		if baseURL == "" {
 			baseURL = "https://api.openai.com/v1"

internal/shell/coreutils.go 🔗

@@ -0,0 +1,19 @@
+package shell
+
+import (
+	"os"
+	"runtime"
+	"strconv"
+)
+
+var useGoCoreUtils bool
+
+func init() {
+	// If CRUSH_CORE_UTILS is set to either true or false, respect that.
+	// By default, enable on Windows only.
+	if v, err := strconv.ParseBool(os.Getenv("CRUSH_CORE_UTILS")); err == nil {
+		useGoCoreUtils = v
+	} else {
+		useGoCoreUtils = runtime.GOOS == "windows"
+	}
+}

internal/shell/shell.go 🔗

@@ -100,7 +100,7 @@ func (s *Shell) Exec(ctx context.Context, command string) (string, string, error
 	s.mu.Lock()
 	defer s.mu.Unlock()
 
-	return s.execPOSIX(ctx, command)
+	return s.exec(ctx, command)
 }
 
 // GetWorkingDir returns the current working directory
@@ -228,8 +228,8 @@ func (s *Shell) blockHandler() func(next interp.ExecHandlerFunc) interp.ExecHand
 	}
 }
 
-// execPOSIX executes commands using POSIX shell emulation (cross-platform)
-func (s *Shell) execPOSIX(ctx context.Context, command string) (string, string, error) {
+// exec executes commands using a cross-platform shell interpreter.
+func (s *Shell) exec(ctx context.Context, command string) (string, string, error) {
 	line, err := syntax.NewParser().Parse(strings.NewReader(command), "")
 	if err != nil {
 		return "", "", fmt.Errorf("could not parse command: %w", err)
@@ -241,7 +241,7 @@ func (s *Shell) execPOSIX(ctx context.Context, command string) (string, string,
 		interp.Interactive(false),
 		interp.Env(expand.ListEnviron(s.env...)),
 		interp.Dir(s.cwd),
-		interp.ExecHandlers(s.blockHandler(), coreutils.ExecHandler),
+		interp.ExecHandlers(s.execHandlers()...),
 	)
 	if err != nil {
 		return "", "", fmt.Errorf("could not run command: %w", err)
@@ -249,14 +249,23 @@ func (s *Shell) execPOSIX(ctx context.Context, command string) (string, string,
 
 	err = runner.Run(ctx, line)
 	s.cwd = runner.Dir
-	s.env = []string{}
 	for name, vr := range runner.Vars {
 		s.env = append(s.env, fmt.Sprintf("%s=%s", name, vr.Str))
 	}
-	s.logger.InfoPersist("POSIX command finished", "command", command, "err", err)
+	s.logger.InfoPersist("command finished", "command", command, "err", err)
 	return stdout.String(), stderr.String(), err
 }
 
+func (s *Shell) execHandlers() []func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc {
+	handlers := []func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc{
+		s.blockHandler(),
+	}
+	if useGoCoreUtils {
+		handlers = append(handlers, coreutils.ExecHandler)
+	}
+	return handlers
+}
+
 // IsInterrupt checks if an error is due to interruption
 func IsInterrupt(err error) bool {
 	return errors.Is(err, context.Canceled) ||

internal/tui/components/chat/messages/renderer.go 🔗

@@ -364,6 +364,17 @@ func (mer multiEditRenderer) Render(v *toolCallCmp) string {
 				Render(fmt.Sprintf("… (%d lines)", len(contentLines)-responseContextHeight))
 			formatted = strings.Join(contentLines[:responseContextHeight], "\n") + "\n" + truncateMessage
 		}
+
+		// Add failed edits warning if any exist
+		if len(meta.EditsFailed) > 0 {
+			noteTag := t.S().Base.Padding(0, 2).Background(t.Info).Foreground(t.White).Render("Note")
+			noteMsg := fmt.Sprintf("%d of %d edits succeeded", meta.EditsApplied, len(params.Edits))
+			note := t.S().Base.
+				Width(v.textWidth() - 2).
+				Render(fmt.Sprintf("%s %s", noteTag, t.S().Muted.Render(noteMsg)))
+			formatted = lipgloss.JoinVertical(lipgloss.Left, formatted, "", note)
+		}
+
 		return formatted
 	})
 }

internal/tui/components/dialogs/permissions/permissions.go 🔗

@@ -698,15 +698,14 @@ func (p *permissionDialogCmp) render() string {
 
 	p.contentViewPort.SetWidth(p.width - 4)
 
-	// Get cached or generate content
-	contentFinal := p.getOrGenerateContent()
-
 	// Always set viewport content (the caching is handled in getOrGenerateContent)
 	const minContentHeight = 9
-	contentHeight := min(
-		max(minContentHeight, p.height-minContentHeight),
-		lipgloss.Height(contentFinal),
-	)
+
+	availableDialogHeight := max(minContentHeight, p.height-minContentHeight)
+	p.contentViewPort.SetHeight(availableDialogHeight)
+	contentFinal := p.getOrGenerateContent()
+	contentHeight := min(availableDialogHeight, lipgloss.Height(contentFinal))
+
 	p.contentViewPort.SetHeight(contentHeight)
 	p.contentViewPort.SetContent(contentFinal)
 

internal/tui/components/logo/logo.go 🔗

@@ -4,7 +4,6 @@ package logo
 import (
 	"fmt"
 	"image/color"
-	"math/rand/v2"
 	"strings"
 
 	"github.com/MakeNowJust/heredoc"
@@ -53,7 +52,7 @@ func Render(version string, compact bool, o Opts) string {
 	}
 	stretchIndex := -1 // -1 means no stretching.
 	if !compact {
-		stretchIndex = rand.IntN(len(letterforms))
+		stretchIndex = cachedRandN(len(letterforms))
 	}
 
 	crush := renderWord(spacing, stretchIndex, letterforms...)
@@ -337,7 +336,7 @@ func stretchLetterformPart(s string, p letterformProps) string {
 	}
 	n := p.width
 	if p.stretch {
-		n = rand.IntN(p.maxStretch-p.minStretch) + p.minStretch //nolint:gosec
+		n = cachedRandN(p.maxStretch-p.minStretch) + p.minStretch //nolint:gosec
 	}
 	parts := make([]string, n)
 	for i := range parts {

internal/tui/components/logo/rand.go 🔗

@@ -0,0 +1,24 @@
+package logo
+
+import (
+	"math/rand/v2"
+	"sync"
+)
+
+var (
+	randCaches   = make(map[int]int)
+	randCachesMu sync.Mutex
+)
+
+func cachedRandN(n int) int {
+	randCachesMu.Lock()
+	defer randCachesMu.Unlock()
+
+	if n, ok := randCaches[n]; ok {
+		return n
+	}
+
+	r := rand.IntN(n)
+	randCaches[n] = r
+	return r
+}

internal/tui/exp/diffview/diffview.go 🔗

@@ -500,19 +500,6 @@ outer:
 		}
 	}
 
-	for printedLines < dv.height {
-		if shouldWrite() {
-			ls := dv.style.MissingLine
-			if dv.lineNumbers {
-				b.WriteString(ls.LineNumber.Render(pad(" ", dv.beforeNumDigits)))
-				b.WriteString(ls.LineNumber.Render(pad(" ", dv.afterNumDigits)))
-			}
-			b.WriteString(ls.Code.Width(dv.fullCodeWidth).Render("  "))
-			b.WriteRune('\n')
-		}
-		printedLines++
-	}
-
 	return b.String()
 }
 
@@ -670,22 +657,6 @@ outer:
 		}
 	}
 
-	for printedLines < dv.height {
-		if shouldWrite() {
-			ls := dv.style.MissingLine
-			if dv.lineNumbers {
-				b.WriteString(ls.LineNumber.Render(pad(" ", dv.beforeNumDigits)))
-			}
-			b.WriteString(ls.Code.Width(dv.fullCodeWidth).Render(" "))
-			if dv.lineNumbers {
-				b.WriteString(ls.LineNumber.Render(pad(" ", dv.afterNumDigits)))
-			}
-			b.WriteString(ls.Code.Width(dv.fullCodeWidth + btoi(dv.extraColOnAfter)).Render(" "))
-			b.WriteRune('\n')
-		}
-		printedLines++
-	}
-
 	return b.String()
 }
 

internal/tui/exp/diffview/diffview_test.go 🔗

@@ -249,8 +249,6 @@ func TestDiffViewHeight(t *testing.T) {
 
 					output := dv.String()
 					golden.RequireEqual(t, []byte(output))
-
-					assertHeight(t, height, output)
 				})
 			}
 		})
@@ -301,8 +299,6 @@ func TestDiffViewYOffset(t *testing.T) {
 
 					output := dv.String()
 					golden.RequireEqual(t, []byte(output))
-
-					assertHeight(t, 5, output)
 				})
 			}
 		})
@@ -328,8 +324,6 @@ func TestDiffViewYOffsetInfinite(t *testing.T) {
 
 					output := dv.String()
 					golden.RequireEqual(t, []byte(output))
-
-					assertHeight(t, 5, output)
 				})
 			}
 		})

internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf016.golden 🔗

@@ -12,5 +12,4 @@
  11   func getContent() string {                       12   func getContent() string {                      

internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf017.golden 🔗

@@ -12,6 +12,4 @@
  11   func getContent() string {                       12   func getContent() string {                      

internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf018.golden 🔗

@@ -12,7 +12,4 @@
  11   func getContent() string {                       12   func getContent() string {                      

internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf019.golden 🔗

@@ -12,8 +12,4 @@
  11   func getContent() string {                       12   func getContent() string {                      

internal/tui/exp/diffview/testdata/TestDiffViewHeight/Split/HeightOf020.golden 🔗

@@ -12,9 +12,4 @@
  11   func getContent() string {                       12   func getContent() string {                      

internal/tui/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf017.golden 🔗

@@ -13,5 +13,4 @@
  12     -     return "Hello, world!"                      
      13 +     content := strings.ToUpper("Hello, World!") 
      14 +     return content                              
- 13  15   }                                               
-                                                          
+ 13  15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf018.golden 🔗

@@ -13,6 +13,4 @@
  12     -     return "Hello, world!"                      
      13 +     content := strings.ToUpper("Hello, World!") 
      14 +     return content                              
- 13  15   }                                               
-                                                          
-                                                          
+ 13  15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf019.golden 🔗

@@ -13,7 +13,4 @@
  12     -     return "Hello, world!"                      
      13 +     content := strings.ToUpper("Hello, World!") 
      14 +     return content                              
- 13  15   }                                               
-                                                          
-                                                          
-                                                          
+ 13  15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewHeight/Unified/HeightOf020.golden 🔗

@@ -13,8 +13,4 @@
  12     -     return "Hello, world!"                      
      13 +     content := strings.ToUpper("Hello, World!") 
      14 +     return content                              
- 13  15   }                                               
-                                                          
-                                                          
-                                                          
-                                                          
+ 13  15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf11.golden 🔗

@@ -1,5 +1,4 @@
  11   func getContent() string {                       12   func getContent() string {                      

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf13.golden 🔗

@@ -1,5 +1,2 @@
                                                        14 +     return content                              
- 13   }                                                15   }                                               
-                                                                                                            
-                                                                                                            
-                                                                                                            
+ 13   }                                                15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf14.golden 🔗

@@ -1,5 +1 @@
- 13   }                                                15   }                                               
-                                                                                                            
-                                                                                                            
-                                                                                                            
-                                                                                                            
+ 13   }                                                15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf15.golden 🔗

@@ -1,5 +0,0 @@
-                                                                                                            
-                                                                                                            
-                                                                                                            
-                                                                                                            
-                                                                                                            

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Split/YOffsetOf16.golden 🔗

@@ -1,5 +0,0 @@
-                                                                                                            
-                                                                                                            
-                                                                                                            
-                                                                                                            
-                                                                                                            

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf12.golden 🔗

@@ -1,5 +1,4 @@
  12     -     return "Hello, world!"                      
      13 +     content := strings.ToUpper("Hello, World!") 
      14 +     return content                              
- 13  15   }                                               
-                                                          
+ 13  15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf13.golden 🔗

@@ -1,5 +1,3 @@
      13 +     content := strings.ToUpper("Hello, World!") 
      14 +     return content                              
- 13  15   }                                               
-                                                          
-                                                          
+ 13  15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf14.golden 🔗

@@ -1,5 +1,2 @@
      14 +     return content                              
- 13  15   }                                               
-                                                          
-                                                          
-                                                          
+ 13  15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf15.golden 🔗

@@ -1,5 +1 @@
- 13  15   }                                               
-                                                          
-                                                          
-                                                          
-                                                          
+ 13  15   }                                               

internal/tui/exp/diffview/testdata/TestDiffViewYOffsetInfinite/Unified/YOffsetOf16.golden 🔗

@@ -1,5 +0,0 @@
-                                                          
-                                                          
-                                                          
-                                                          
-                                                          

internal/tui/tui.go 🔗

@@ -4,6 +4,7 @@ import (
 	"context"
 	"fmt"
 	"math/rand"
+	"slices"
 	"strings"
 	"time"
 
@@ -72,6 +73,14 @@ type appModel struct {
 
 	// Chat Page Specific
 	selectedSessionID string // The ID of the currently selected session
+
+	// sendProgressBar instructs the TUI to send progress bar updates to the
+	// terminal.
+	sendProgressBar bool
+
+	// QueryVersion instructs the TUI to query for the terminal version when it
+	// starts.
+	QueryVersion bool
 }
 
 // Init initializes the application model and returns initial commands.
@@ -88,6 +97,9 @@ func (a appModel) Init() tea.Cmd {
 
 	cmd = a.status.Init()
 	cmds = append(cmds, cmd)
+	if a.QueryVersion {
+		cmds = append(cmds, tea.RequestTerminalVersion)
+	}
 
 	return tea.Batch(cmds...)
 }
@@ -99,6 +111,18 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 	a.isConfigured = config.HasInitialDataConfig()
 
 	switch msg := msg.(type) {
+	case tea.EnvMsg:
+		// Is this Windows Terminal?
+		if !a.sendProgressBar {
+			a.sendProgressBar = slices.Contains(msg, "WT_SESSION")
+		}
+	case tea.TerminalVersionMsg:
+		termVersion := strings.ToLower(string(msg))
+		// Only enable progress bar for the following terminals.
+		if !a.sendProgressBar {
+			a.sendProgressBar = strings.Contains(termVersion, "ghostty")
+		}
+		return a, nil
 	case tea.KeyboardEnhancementsMsg:
 		for id, page := range a.pages {
 			m, pageCmd := page.Update(msg)
@@ -479,6 +503,7 @@ func (a *appModel) moveToPage(pageID page.PageID) tea.Cmd {
 // View renders the complete application interface including pages, dialogs, and overlays.
 func (a *appModel) View() tea.View {
 	var view tea.View
+	view.AltScreen = true
 	t := styles.CurrentTheme()
 	view.BackgroundColor = t.BgBase
 	if a.wWidth < 25 || a.wHeight < 15 {
@@ -553,9 +578,8 @@ func (a *appModel) View() tea.View {
 	view.Layer = canvas
 	view.Cursor = cursor
 	view.MouseMode = tea.MouseModeCellMotion
-	view.AltScreen = true
 
-	if a.app != nil && a.app.AgentCoordinator != nil && a.app.AgentCoordinator.IsBusy() {
+	if a.sendProgressBar && a.app != nil && a.app.AgentCoordinator != nil && a.app.AgentCoordinator.IsBusy() {
 		// HACK: use a random percentage to prevent ghostty from hiding it
 		// after a timeout.
 		view.ProgressBar = tea.NewProgressBar(tea.ProgressBarIndeterminate, rand.Intn(100))
@@ -564,7 +588,7 @@ func (a *appModel) View() tea.View {
 }
 
 // New creates and initializes a new TUI application model.
-func New(app *app.App) tea.Model {
+func New(app *app.App) *appModel {
 	chatPage := chat.New(app)
 	keyMap := DefaultKeyMap()
 	keyMap.pageBindings = chatPage.Bindings()

internal/ui/model/ui.go 🔗

@@ -3,6 +3,8 @@ package model
 import (
 	"image"
 	"math/rand"
+	"slices"
+	"strings"
 
 	"github.com/charmbracelet/bubbles/v2/help"
 	"github.com/charmbracelet/bubbles/v2/key"
@@ -38,6 +40,14 @@ type UI struct {
 	help   help.Model
 
 	layout layout
+
+	// sendProgressBar instructs the TUI to send progress bar updates to the
+	// terminal.
+	sendProgressBar bool
+
+	// QueryVersion instructs the TUI to query for the terminal version when it
+	// starts.
+	QueryVersion bool
 }
 
 // New creates a new instance of the [UI] model.
@@ -54,6 +64,10 @@ func New(com *common.Common, app *app.App) *UI {
 
 // Init initializes the UI model.
 func (m *UI) Init() tea.Cmd {
+	if m.QueryVersion {
+		return tea.RequestTerminalVersion
+	}
+
 	return nil
 }
 
@@ -61,6 +75,18 @@ func (m *UI) Init() tea.Cmd {
 func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 	var cmds []tea.Cmd
 	switch msg := msg.(type) {
+	case tea.EnvMsg:
+		// Is this Windows Terminal?
+		if !m.sendProgressBar {
+			m.sendProgressBar = slices.Contains(msg, "WT_SESSION")
+		}
+	case tea.TerminalVersionMsg:
+		termVersion := strings.ToLower(string(msg))
+		// Only enable progress bar for the following terminals.
+		if !m.sendProgressBar {
+			m.sendProgressBar = strings.Contains(termVersion, "ghostty")
+		}
+		return m, nil
 	case tea.WindowSizeMsg:
 		m.updateLayout(msg.Width, msg.Height)
 		m.editor.SetSize(m.layout.editor.Dx(), m.layout.editor.Dy())
@@ -161,6 +187,11 @@ func (m *UI) View() tea.View {
 	layers = append(layers, mainLayer)
 
 	v.Layer = lipgloss.NewCanvas(layers...)
+	if m.sendProgressBar && m.app != nil && m.app.AgentCoordinator != nil && m.app.AgentCoordinator.IsBusy() {
+		// HACK: use a random percentage to prevent ghostty from hiding it
+		// after a timeout.
+		v.ProgressBar = tea.NewProgressBar(tea.ProgressBarIndeterminate, rand.Intn(100))
+	}
 
 	return v
 }