Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to this project are documented in this file. The format is b

### Fixed

- **The LLM connection test sends no tools**: the test passes an empty tool list, but the agent SDK still added its background-task tools (`TaskOutput`, `TaskStop`, `TaskList`, `Monitor`), so some models answered with a call to one of them or with tool-like text instead of `OK`, and a local reasoning model could spend the whole 30-second budget deciding whether to use them. The test now turns those tools off, the same way goal decomposition does (#526).
- **Missing Docker buildx is reported before the build**: without the buildx plugin, Compose only warns and falls back to the legacy builder, which fails on the Dockerfile's first `FROM --platform=$BUILDPLATFORM` with `failed to parse platform`. `install.sh` (all-Docker) and `update.sh` (Docker update) now check `docker buildx version` first and stop with an install hint, and the automatic Docker install on apt-based distros not covered by get.docker.com installs the buildx package as well. The README Docker section names buildx as a requirement.
- **A goal URL followed by punctuation is still seeded**: a goal such as `Assess http://juiceshop:3000.` no longer logs `could not parse a target host/IP` and skips the site. Trailing punctuation, including full-width `。` and a closing bracket that has no matching opener, is trimmed from the URL before it is parsed, so `http://[::1]` is left alone. The scheme the goal names is kept and a final period does not end up in the host.
- **Task timeout triggers fire for every task**: `on_task_timeout` used the task id as a watermark, but tasks time out in deadline order. Once a newer task timed out first, an older task that timed out later was never fired for. Fired timeouts are now kept in a persisted set, like met goals; on first start the set is seeded with the tasks already timed out, so nothing replays.
Expand Down
38 changes: 38 additions & 0 deletions agent/conntest_tools_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package agent

import (
"context"
"encoding/json"
"io"
"net/http"
"net/http/httptest"
"testing"
)

// The connection test must send a bare chat request. Models given the SDK's
// background-task tools answered the test by calling TaskOutput instead of OK (#526).
func TestConnectionSendsNoTools(t *testing.T) {
var body []byte
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
body, _ = io.ReadAll(r.Body)
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{"id":"x","object":"chat.completion","model":"m","choices":[{"index":0,"message":{"role":"assistant","content":"OK"},"finish_reason":"stop"}],"usage":{"prompt_tokens":1,"completion_tokens":1,"total_tokens":2}}`))
}))
defer server.Close()

cfg := ConfigFrom("ollama", "m", server.URL+"/v1", "", "")
cfg.Stream = false
_, reply, err := TestConnection(context.Background(), cfg)
if err != nil || reply != "OK" {
t.Fatalf("TestConnection = %q, %v; want OK", reply, err)
}
var req struct {
Tools []json.RawMessage `json:"tools"`
}
if err := json.Unmarshal(body, &req); err != nil {
t.Fatalf("request body: %v\n%s", err, body)
}
if len(req.Tools) != 0 {
t.Fatalf("connection test sent %d tools, want none:\n%s", len(req.Tools), body)
}
}
3 changes: 3 additions & 0 deletions agent/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ func TestConnection(ctx context.Context, c Config) (time.Duration, string, error
MaxTurns: 1,
MaxTokens: 8192,
NonStreaming: !c.Stream, // use this profile's real send/receive mode for the connection test
// Without this the SDK still adds TaskOutput/TaskStop/TaskList/Monitor, and
// some models answer the test with a call to one of them instead of OK.
DisableBackgroundTasks: true,
}, "ping")
lat := time.Since(start)
if err != nil {
Expand Down
Loading