From 4d0eced9f4d9c6081d8d5ce6890a400234663419 Mon Sep 17 00:00:00 2001 From: harmoon Date: Sun, 5 Apr 2026 12:46:56 +0800 Subject: [PATCH] style(agent): format whitespace in hook structs and constants Remove trailing whitespace and standardize spacing in JSON struct tags, constants, and test data for improved code consistency. --- pkg/agent/hook_process.go | 4 ++-- pkg/agent/hooks.go | 2 +- pkg/agent/hooks_test.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/agent/hook_process.go b/pkg/agent/hook_process.go index 1e6bf128e..59dc8ad62 100644 --- a/pkg/agent/hook_process.go +++ b/pkg/agent/hook_process.go @@ -91,8 +91,8 @@ type processHookAfterLLMResponse struct { type processHookBeforeToolResponse struct { processHookDecisionResponse - Call *ToolCallHookRequest `json:"call,omitempty"` - Result *tools.ToolResult `json:"result,omitempty"` // Result returned directly by hook (for respond action) + Call *ToolCallHookRequest `json:"call,omitempty"` + Result *tools.ToolResult `json:"result,omitempty"` // Result returned directly by hook (for respond action) } type processHookAfterToolResponse struct { diff --git a/pkg/agent/hooks.go b/pkg/agent/hooks.go index 3e4a69c14..0d30a0d39 100644 --- a/pkg/agent/hooks.go +++ b/pkg/agent/hooks.go @@ -25,7 +25,7 @@ type HookAction string const ( HookActionContinue HookAction = "continue" HookActionModify HookAction = "modify" - HookActionRespond HookAction = "respond" // Return result directly, skip tool execution + HookActionRespond HookAction = "respond" // Return result directly, skip tool execution HookActionDenyTool HookAction = "deny_tool" HookActionAbortTurn HookAction = "abort_turn" HookActionHardAbort HookAction = "hard_abort" diff --git a/pkg/agent/hooks_test.go b/pkg/agent/hooks_test.go index c3ab2f836..94779e7f8 100644 --- a/pkg/agent/hooks_test.go +++ b/pkg/agent/hooks_test.go @@ -356,10 +356,10 @@ func (h *respondHook) BeforeTool( if h.respondTools[call.Tool] { next := call.Clone() next.HookResult = &tools.ToolResult{ - ForLLM: "hook-responded: " + call.Tool, - ForUser: "", - Silent: false, - IsError: false, + ForLLM: "hook-responded: " + call.Tool, + ForUser: "", + Silent: false, + IsError: false, } return next, HookDecision{Action: HookActionRespond}, nil }