Skip to content

Commit 1ff0216

Browse files
committed
chore(tools): apply gofmt formatting fixes
1 parent 913eef9 commit 1ff0216

File tree

10 files changed

+47
-31
lines changed

10 files changed

+47
-31
lines changed

agent/tools/delegate_task_test.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ func TestDelegateTask_AsyncCompleted(t *testing.T) {
319319
if err != nil {
320320
t.Fatalf("Execute: %v", err)
321321
}
322-
var resp struct{ TaskID string `json:"task_id"` }
322+
var resp struct {
323+
TaskID string `json:"task_id"`
324+
}
323325
json.Unmarshal([]byte(result), &resp)
324326

325327
// Wait for goroutine to start, then release.
@@ -374,7 +376,9 @@ func TestDelegateTask_AsyncFailed(t *testing.T) {
374376
if err != nil {
375377
t.Fatalf("Execute: %v", err)
376378
}
377-
var resp struct{ TaskID string `json:"task_id"` }
379+
var resp struct {
380+
TaskID string `json:"task_id"`
381+
}
378382
json.Unmarshal([]byte(result), &resp)
379383

380384
<-runner.called
@@ -572,7 +576,9 @@ func TestDelegateTask_AsyncStreamingCompleted(t *testing.T) {
572576
if err != nil {
573577
t.Fatalf("Execute: %v", err)
574578
}
575-
var resp struct{ TaskID string `json:"task_id"` }
579+
var resp struct {
580+
TaskID string `json:"task_id"`
581+
}
576582
json.Unmarshal([]byte(result), &resp)
577583

578584
// Wait for completion notification.
@@ -627,7 +633,9 @@ func TestDelegateTask_AsyncStreamingFailed(t *testing.T) {
627633
if err != nil {
628634
t.Fatalf("Execute: %v", err)
629635
}
630-
var resp struct{ TaskID string `json:"task_id"` }
636+
var resp struct {
637+
TaskID string `json:"task_id"`
638+
}
631639
json.Unmarshal([]byte(result), &resp)
632640

633641
select {
@@ -921,7 +929,9 @@ func TestDelegateTask_AsyncWritesResultFile(t *testing.T) {
921929
if err != nil {
922930
t.Fatalf("Execute: %v", err)
923931
}
924-
var resp struct{ TaskID string `json:"task_id"` }
932+
var resp struct {
933+
TaskID string `json:"task_id"`
934+
}
925935
json.Unmarshal([]byte(result), &resp)
926936

927937
<-runner.called

agent/tools/file.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ func (f *FileReadTool) Execute(_ context.Context, input json.RawMessage) (string
4141
// FileWriteTool writes content to a file.
4242
type FileWriteTool struct{}
4343

44-
func (f *FileWriteTool) Name() string { return "file_write" }
45-
func (f *FileWriteTool) Description() string { return "Write content to a file (creates or overwrites)" }
44+
func (f *FileWriteTool) Name() string { return "file_write" }
45+
func (f *FileWriteTool) Description() string {
46+
return "Write content to a file (creates or overwrites)"
47+
}
4648
func (f *FileWriteTool) InputSchema() json.RawMessage {
4749
return json.RawMessage(`{
4850
"type": "object",

agent/tools/gws_execute_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ func TestGWSExecute_StructuredParams(t *testing.T) {
378378
input, _ := json.Marshal(map[string]any{
379379
"command": "drive files list",
380380
"params": map[string]any{
381-
"q": "mimeType='application/vnd.google-apps.document'",
382-
"orderBy": "modifiedTime desc",
381+
"q": "mimeType='application/vnd.google-apps.document'",
382+
"orderBy": "modifiedTime desc",
383383
"pageSize": 5,
384384
},
385385
})

agent/tools/interactor.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ type Interactor interface {
1212
// RequestApproval asks the user to approve an action. Blocks until the user responds.
1313
RequestApproval(description string) (approved bool, err error)
1414
}
15-

agent/tools/load_skills.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import (
1414
// LoadSkillsTool reads full SKILL.md content for named skills.
1515
type LoadSkillsTool struct{}
1616

17-
func (l *LoadSkillsTool) Name() string { return "load_skills" }
18-
func (l *LoadSkillsTool) Description() string { return "Load full skill instructions for the specified skills" }
17+
func (l *LoadSkillsTool) Name() string { return "load_skills" }
18+
func (l *LoadSkillsTool) Description() string {
19+
return "Load full skill instructions for the specified skills"
20+
}
1921
func (l *LoadSkillsTool) InputSchema() json.RawMessage {
2022
return json.RawMessage(`{
2123
"type": "object",

agent/tools/risk.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ const (
88
RiskMedium // standard approval (current behavior)
99
RiskHigh // enhanced approval with full preview
1010
)
11-

agent/tools/sanitize_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ func TestNormalizeHomoglyphs(t *testing.T) {
131131
want string
132132
}{
133133
{"hello", "hello"},
134-
{"\u0430bc", "abc"}, // Cyrillic a → a
135-
{"te\u200bst", "test"}, // zero-width space removed
136-
{"\u0456gnore", "ignore"}, // Cyrillic і → i
134+
{"\u0430bc", "abc"}, // Cyrillic a → a
135+
{"te\u200bst", "test"}, // zero-width space removed
136+
{"\u0456gnore", "ignore"}, // Cyrillic і → i
137137
}
138138
for _, tc := range cases {
139139
if got := normalizeHomoglyphs(tc.input); got != tc.want {

agent/tools/subagent_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ type stubTool struct {
3838
output string
3939
}
4040

41-
func (s *stubTool) Name() string { return s.name }
42-
func (s *stubTool) Description() string { return "stub" }
43-
func (s *stubTool) InputSchema() json.RawMessage { return json.RawMessage(`{"type":"object"}`) }
44-
func (s *stubTool) Execute(_ context.Context, _ json.RawMessage) (string, error) { return s.output, nil }
41+
func (s *stubTool) Name() string { return s.name }
42+
func (s *stubTool) Description() string { return "stub" }
43+
func (s *stubTool) InputSchema() json.RawMessage { return json.RawMessage(`{"type":"object"}`) }
44+
func (s *stubTool) Execute(_ context.Context, _ json.RawMessage) (string, error) {
45+
return s.output, nil
46+
}
4547

4648
func newSubagentTool(mp *mockProvider) *tools.SubagentTool {
4749
return tools.NewSubagentTool(tools.SubagentConfig{

agent/tools/tools_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,12 @@ type stubTool struct {
194194
output string
195195
}
196196

197-
func (s *stubTool) Name() string { return s.name }
198-
func (s *stubTool) Description() string { return "stub" }
199-
func (s *stubTool) InputSchema() json.RawMessage { return json.RawMessage(`{"type":"object"}`) }
200-
func (s *stubTool) Execute(_ context.Context, _ json.RawMessage) (string, error) { return s.output, nil }
197+
func (s *stubTool) Name() string { return s.name }
198+
func (s *stubTool) Description() string { return "stub" }
199+
func (s *stubTool) InputSchema() json.RawMessage { return json.RawMessage(`{"type":"object"}`) }
200+
func (s *stubTool) Execute(_ context.Context, _ json.RawMessage) (string, error) {
201+
return s.output, nil
202+
}
201203

202204
func TestBashTool_TruncatesLargeOutput(t *testing.T) {
203205
b := NewBashTool(10 * time.Second)

agent/tools/truncate.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import (
77

88
// Standard truncation limits shared across tools.
99
const (
10-
MaxOutputBytes = 50 * 1024 // 50KB byte cap for all tools.
11-
MaxLinesBash = 2000 // bash: tail-truncate (errors at bottom).
12-
MaxLinesFileRead = 2000 // file_read: head-truncate.
13-
MaxLinesWebFetch = 1000 // web_fetch: head-truncate.
14-
MaxLinesSlack = 1000 // slack_*: head-truncate.
15-
MaxLinesWebSearch = 500 // web_search: head-truncate.
16-
MaxLinesHeadTail = 500 // gws/subagent/delegate: head+tail.
10+
MaxOutputBytes = 50 * 1024 // 50KB byte cap for all tools.
11+
MaxLinesBash = 2000 // bash: tail-truncate (errors at bottom).
12+
MaxLinesFileRead = 2000 // file_read: head-truncate.
13+
MaxLinesWebFetch = 1000 // web_fetch: head-truncate.
14+
MaxLinesSlack = 1000 // slack_*: head-truncate.
15+
MaxLinesWebSearch = 500 // web_search: head-truncate.
16+
MaxLinesHeadTail = 500 // gws/subagent/delegate: head+tail.
1717
)
1818

1919
// TruncateHead keeps the first maxLines lines (for file_read, web results).

0 commit comments

Comments
 (0)