Skip to content

Commit fd45b2b

Browse files
committed
fix: Fixed formatting issues
1 parent 77edc1b commit fd45b2b

File tree

16 files changed

+182
-241
lines changed

16 files changed

+182
-241
lines changed

cmd/scriptschnell/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,9 @@ func runTUI(cfg *config.Config, providerMgr *provider.Manager) error {
830830
SessionID: sessionID,
831831
ResponseChan: make(chan actor.SessionStorageDeleteResponse, 1),
832832
}
833-
storageRef.Send(deleteMsg)
833+
if err := storageRef.Send(deleteMsg); err != nil {
834+
return fmt.Errorf("failed to send delete message: %w", err)
835+
}
834836
response := <-deleteMsg.ResponseChan
835837
if response.Err != nil {
836838
return fmt.Errorf("failed to delete session: %w", response.Err)

go.mod

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ require (
2424
github.com/tree-sitter/tree-sitter-go v0.25.0
2525
github.com/tree-sitter/tree-sitter-python v0.25.0
2626
github.com/tree-sitter/tree-sitter-typescript v0.23.2
27-
golang.org/x/crypto v0.45.0
28-
golang.org/x/net v0.47.0
29-
golang.org/x/term v0.37.0
30-
google.golang.org/genai v1.37.0
27+
golang.org/x/crypto v0.46.0
28+
golang.org/x/net v0.48.0
29+
golang.org/x/term v0.38.0
30+
google.golang.org/genai v1.38.0
3131
)
3232

3333
require (
@@ -42,7 +42,7 @@ require (
4242
github.com/charmbracelet/colorprofile v0.3.3 // indirect
4343
github.com/charmbracelet/x/ansi v0.11.2 // indirect
4444
github.com/charmbracelet/x/cellbuf v0.0.14 // indirect
45-
github.com/charmbracelet/x/exp/slice v0.0.0-20251201173703-9f73bfd934ff // indirect
45+
github.com/charmbracelet/x/exp/slice v0.0.0-20251210182518-b3d4d1ed2373 // indirect
4646
github.com/charmbracelet/x/term v0.2.2 // indirect
4747
github.com/clipperhouse/displaywidth v0.6.1 // indirect
4848
github.com/clipperhouse/stringish v0.1.1 // indirect
@@ -52,7 +52,7 @@ require (
5252
github.com/felixge/httpsnoop v1.0.4 // indirect
5353
github.com/go-logr/logr v1.4.3 // indirect
5454
github.com/go-logr/stdr v1.2.2 // indirect
55-
github.com/go-openapi/jsonpointer v0.22.3 // indirect
55+
github.com/go-openapi/jsonpointer v0.22.4 // indirect
5656
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
5757
github.com/google/go-cmp v0.7.0 // indirect
5858
github.com/google/s2a-go v0.1.9 // indirect
@@ -87,12 +87,12 @@ require (
8787
github.com/yuin/goldmark v1.7.13 // indirect
8888
github.com/yuin/goldmark-emoji v1.0.6 // indirect
8989
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
90-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
91-
go.opentelemetry.io/otel v1.38.0 // indirect
92-
go.opentelemetry.io/otel/metric v1.38.0 // indirect
93-
go.opentelemetry.io/otel/trace v1.38.0 // indirect
94-
golang.org/x/sys v0.38.0 // indirect
95-
golang.org/x/text v0.31.0 // indirect
90+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 // indirect
91+
go.opentelemetry.io/otel v1.39.0 // indirect
92+
go.opentelemetry.io/otel/metric v1.39.0 // indirect
93+
go.opentelemetry.io/otel/trace v1.39.0 // indirect
94+
golang.org/x/sys v0.39.0 // indirect
95+
golang.org/x/text v0.32.0 // indirect
9696
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
9797
google.golang.org/grpc v1.77.0 // indirect
9898
google.golang.org/protobuf v1.36.10 // indirect

go.sum

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payR
4646
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
4747
github.com/charmbracelet/x/exp/slice v0.0.0-20251201173703-9f73bfd934ff h1:Uwr+/JS+qnRcO/++xjYEDtW7x+P5E4+4cBiOHTt2Xfk=
4848
github.com/charmbracelet/x/exp/slice v0.0.0-20251201173703-9f73bfd934ff/go.mod h1:vqEfX6xzqW1pKKZUUiFOKg0OQ7bCh54Q2vR/tserrRA=
49+
github.com/charmbracelet/x/exp/slice v0.0.0-20251210182518-b3d4d1ed2373 h1:2NaW38gkQs5W7HFoFvCrD0VZnSLzD4126YKiAlMr7nU=
50+
github.com/charmbracelet/x/exp/slice v0.0.0-20251210182518-b3d4d1ed2373/go.mod h1:vqEfX6xzqW1pKKZUUiFOKg0OQ7bCh54Q2vR/tserrRA=
4951
github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk=
5052
github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI=
5153
github.com/clipperhouse/displaywidth v0.6.1 h1:/zMlAezfDzT2xy6acHBzwIfyu2ic0hgkT83UX5EY2gY=
@@ -77,6 +79,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
7779
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
7880
github.com/go-openapi/jsonpointer v0.22.3 h1:dKMwfV4fmt6Ah90zloTbUKWMD+0he+12XYAsPotrkn8=
7981
github.com/go-openapi/jsonpointer v0.22.3/go.mod h1:0lBbqeRsQ5lIanv3LHZBrmRGHLHcQoOXQnf88fHlGWo=
82+
github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4=
83+
github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80=
8084
github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI=
8185
github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag=
8286
github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls=
@@ -222,37 +226,60 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ
222226
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
223227
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18=
224228
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg=
229+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 h1:ssfIgGNANqpVFCndZvcuyKbl0g+UAVcbBcqGkG28H0Y=
230+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0/go.mod h1:GQ/474YrbE4Jx8gZ4q5I4hrhUzM6UPzyrqJYV2AqPoQ=
225231
go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
226232
go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
233+
go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
234+
go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8=
227235
go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
228236
go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
237+
go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0=
238+
go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs=
229239
go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
230240
go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=
241+
go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18=
231242
go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=
232243
go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
244+
go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8=
233245
go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
234246
go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
247+
go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI=
248+
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
235249
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
236250
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
251+
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
252+
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
237253
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
238254
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
239255
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
240256
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
257+
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
258+
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
241259
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
242260
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
261+
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
243262
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
244263
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
245264
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
246265
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
266+
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
267+
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
247268
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
248269
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
270+
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
271+
golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg=
249272
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
250273
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
274+
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
275+
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
251276
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
252277
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
253278
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
254279
google.golang.org/genai v1.37.0 h1:dgp71k1wQ+/+APdZrN3LFgAGnVnr5IdTF1Oj0Dg+BQc=
255280
google.golang.org/genai v1.37.0/go.mod h1:A3kkl0nyBjyFlNjgxIwKq70julKbIxpSxqKO5gw/gmk=
281+
google.golang.org/genai v1.38.0 h1:aE+kIjkmV9/gX5HjEv7ZQkw1sAAMM+9tW4a/RUhKdFk=
282+
google.golang.org/genai v1.38.0/go.mod h1:A3kkl0nyBjyFlNjgxIwKq70julKbIxpSxqKO5gw/gmk=
256283
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=
257284
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
258285
google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=

internal/config/config.go

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ type MCPOpenAIConfig struct {
8484

8585
// AutoSaveConfig holds configuration for automatic session saving
8686
type AutoSaveConfig struct {
87-
Enabled bool `json:"enabled"`
87+
Enabled bool `json:"enabled"`
8888
SaveIntervalSeconds int `json:"save_interval_seconds"`
89-
MaxConcurrentSaves int `json:"max_concurrent_saves"`
89+
MaxConcurrentSaves int `json:"max_concurrent_saves"`
9090
}
9191

9292
// Config represents application configuration
@@ -111,7 +111,7 @@ type Config struct {
111111
PromptCacheTTL string `json:"prompt_cache_ttl,omitempty"` // Cache TTL: "5m" or "1h" (default: "1h", Anthropic only)
112112
ContextDirectories map[string][]string `json:"context_directories,omitempty"` // Workspace-specific context directories (map of workspace path -> directories)
113113
OpenTabs map[string]*WorkspaceTabState `json:"open_tabs,omitempty"` // Workspace-specific open tabs state (map of workspace path -> tab state)
114-
AutoSave AutoSaveConfig `json:"auto_save,omitempty"` // Session auto-save configuration
114+
AutoSave AutoSaveConfig `json:"auto_save,omitempty"` // Session auto-save configuration
115115

116116
authMu sync.RWMutex `json:"-"` // Protects AuthorizedDomains and AuthorizedCommands for concurrent access
117117
secretsPassword string `json:"-"`
@@ -200,9 +200,9 @@ func DefaultConfig() *Config {
200200
PromptCacheTTL: "1h", // Default to 1 hour for longer sessions
201201
ContextDirectories: make(map[string][]string), // No context directories by default
202202
AutoSave: AutoSaveConfig{
203-
Enabled: true, // Enable by default
204-
SaveIntervalSeconds: 5, // Save every 5 seconds
205-
MaxConcurrentSaves: 1, // Only one save operation at a time
203+
Enabled: true, // Enable by default
204+
SaveIntervalSeconds: 5, // Save every 5 seconds
205+
MaxConcurrentSaves: 1, // Only one save operation at a time
206206
},
207207
}
208208
}
@@ -459,8 +459,27 @@ func (c *Config) decryptSensitiveFields(password string) error {
459459
}
460460

461461
func (c *Config) marshalWithEncryptedSecrets() ([]byte, error) {
462-
copyCfg := *c
463-
copyCfg.Search = c.Search
462+
copyCfg := Config{
463+
WorkingDir: c.WorkingDir,
464+
CacheTTL: c.CacheTTL,
465+
MaxCacheEntries: c.MaxCacheEntries,
466+
DefaultTimeout: c.DefaultTimeout,
467+
TempDir: c.TempDir,
468+
Temperature: c.Temperature,
469+
MaxTokens: c.MaxTokens,
470+
ProviderConfigPath: c.ProviderConfigPath,
471+
DisableAnimations: c.DisableAnimations,
472+
LogLevel: c.LogLevel,
473+
LogPath: c.LogPath,
474+
AuthorizedDomains: c.AuthorizedDomains,
475+
AuthorizedCommands: c.AuthorizedCommands,
476+
Search: c.Search,
477+
MCP: c.MCP,
478+
Secrets: c.Secrets,
479+
EnablePromptCache: c.EnablePromptCache,
480+
AutoSave: c.AutoSave,
481+
secretsPassword: c.secretsPassword,
482+
}
464483

465484
var err error
466485
copyCfg.Search.Exa.APIKey, err = encryptField(copyCfg.Search.Exa.APIKey, c.secretsPassword)

internal/llm/openai_compatible_client_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ func TestOpenAICompatibleClient_UsageData(t *testing.T) {
3939
}
4040

4141
w.Header().Set("Content-Type", "application/json")
42-
json.NewEncoder(w).Encode(response)
42+
if err := json.NewEncoder(w).Encode(response); err != nil {
43+
http.Error(w, err.Error(), http.StatusInternalServerError)
44+
return
45+
}
4346
}))
4447
defer server.Close()
4548

@@ -110,7 +113,10 @@ func TestOpenAICompatibleClient_UsageData_NoUsage(t *testing.T) {
110113
}
111114

112115
w.Header().Set("Content-Type", "application/json")
113-
json.NewEncoder(w).Encode(response)
116+
if err := json.NewEncoder(w).Encode(response); err != nil {
117+
http.Error(w, err.Error(), http.StatusInternalServerError)
118+
return
119+
}
114120
}))
115121
defer server.Close()
116122

@@ -142,4 +148,4 @@ func TestOpenAICompatibleClient_UsageData_NoUsage(t *testing.T) {
142148
if resp.Usage != nil {
143149
t.Errorf("Expected usage data to be nil, got %v", resp.Usage)
144150
}
145-
}
151+
}

internal/orchestrator/orchestrator.go

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,12 +1009,32 @@ func (o *Orchestrator) TestMCPServer(serverName string) error {
10091009
return fmt.Errorf("mcp server not found: %s", serverName)
10101010
}
10111011

1012-
tmpCfg := *o.config
1013-
tmpCfg.MCP.Servers = map[string]*config.MCPServerConfig{
1014-
serverName: server,
1012+
tmpCfg := &config.Config{
1013+
WorkingDir: o.config.WorkingDir,
1014+
CacheTTL: o.config.CacheTTL,
1015+
MaxCacheEntries: o.config.MaxCacheEntries,
1016+
DefaultTimeout: o.config.DefaultTimeout,
1017+
TempDir: o.config.TempDir,
1018+
Temperature: o.config.Temperature,
1019+
MaxTokens: o.config.MaxTokens,
1020+
ProviderConfigPath: o.config.ProviderConfigPath,
1021+
DisableAnimations: o.config.DisableAnimations,
1022+
LogLevel: o.config.LogLevel,
1023+
LogPath: o.config.LogPath,
1024+
AuthorizedDomains: o.config.AuthorizedDomains,
1025+
AuthorizedCommands: o.config.AuthorizedCommands,
1026+
Search: o.config.Search,
1027+
MCP: config.MCPConfig{
1028+
Servers: map[string]*config.MCPServerConfig{
1029+
serverName: server,
1030+
},
1031+
},
1032+
Secrets: o.config.Secrets,
1033+
EnablePromptCache: o.config.EnablePromptCache,
1034+
AutoSave: o.config.AutoSave,
10151035
}
10161036

1017-
manager := mcp.NewManager(&tmpCfg, o.workingDir, o.providerMgr)
1037+
manager := mcp.NewManager(tmpCfg, o.workingDir, o.providerMgr)
10181038
tools, errs := manager.BuildTools()
10191039
if len(errs) > 0 {
10201040
messages := make([]string, 0, len(errs))

internal/orchestrator/tool_validation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ func TestToolCallValidationErrorNil(t *testing.T) {
114114
if err.Error() != "" {
115115
t.Errorf("Expected empty string for nil error, got: %s", err.Error())
116116
}
117-
}
117+
}

internal/session/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type Message struct {
3232
// Session manages a conversation session
3333
type Session struct {
3434
ID string
35-
Title string // Auto-generated title for the session
35+
Title string // Auto-generated title for the session
3636
WorkingDir string
3737
Messages []*Message
3838
FilesRead map[string]string // path -> content

internal/session/session_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ func TestCompactWithSummaryMismatch(t *testing.T) {
5050
func TestSaveEmptySession(t *testing.T) {
5151
// Create a temporary directory for testing
5252
tempDir := t.TempDir()
53-
53+
5454
// Create session storage
5555
storage, err := NewSessionStorage()
5656
if err != nil {
5757
t.Fatalf("Failed to create session storage: %v", err)
5858
}
59-
59+
6060
// Test 1: Try to save an empty session
6161
emptySession := NewSession("test-empty", tempDir)
6262
err = storage.SaveSession(emptySession, "Empty Session")
6363
if err != nil {
6464
t.Errorf("Unexpected error saving empty session: %v", err)
6565
}
66-
66+
6767
// Verify no session was saved
6868
sessions, err := storage.ListSessions(tempDir)
6969
if err != nil {
@@ -72,18 +72,18 @@ func TestSaveEmptySession(t *testing.T) {
7272
if len(sessions) != 0 {
7373
t.Errorf("Expected 0 sessions after saving empty session, got %d", len(sessions))
7474
}
75-
75+
7676
// Test 2: Save a session with messages
7777
sessionWithMessages := NewSession("test-with-messages", tempDir)
7878
sessionWithMessages.AddMessage(&Message{
79-
Role: "user",
80-
Content: "Hello, world!",
81-
})
79+
Role: "user",
80+
Content: "Hello, world!",
81+
})
8282
err = storage.SaveSession(sessionWithMessages, "Session with Messages")
8383
if err != nil {
8484
t.Errorf("Unexpected error saving session with messages: %v", err)
8585
}
86-
86+
8787
// Verify session was saved
8888
sessions, err = storage.ListSessions(tempDir)
8989
if err != nil {
@@ -101,26 +101,26 @@ func TestSaveSessionStorageDirectoryOverride(t *testing.T) {
101101
// This test validates the behavior when we need to test with a specific directory
102102
// In practice, the actual tests above work with the system's session storage
103103
tempDir := t.TempDir()
104-
104+
105105
// Create a session
106106
s := NewSession("test", tempDir)
107-
107+
108108
// Initially it should be dirty
109109
if !s.IsDirty() {
110110
t.Error("New session should be dirty")
111111
}
112-
112+
113113
// Add a message
114114
s.AddMessage(&Message{Role: "user", Content: "test"})
115-
115+
116116
// Should still be dirty
117117
if !s.IsDirty() {
118118
t.Error("Session with new message should be dirty")
119119
}
120-
120+
121121
// Mark as saved
122122
s.MarkSaved(s.UpdatedAt)
123-
123+
124124
// Should no longer be dirty
125125
if s.IsDirty() {
126126
t.Error("Session should not be dirty after being marked as saved")

0 commit comments

Comments
 (0)