From 4c96d8194a295bfc84d39a16579cde05b50015f3 Mon Sep 17 00:00:00 2001 From: seagochen Date: Tue, 10 Mar 2026 12:46:51 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8E=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除多余的空行 (loop.go, loop_test.go) - 格式化长字符串参数,提高可读性 (cmd_mode.go) - 修复注释对齐 (runtime.go) --- pkg/agent/loop.go | 1 - pkg/agent/loop_test.go | 1 - pkg/commands/cmd_mode.go | 4 +++- pkg/commands/runtime.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 217943744..29d575fc4 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -1999,7 +1999,6 @@ func (al *AgentLoop) buildCommandsRuntime(agent *AgentInstance, opts *processOpt agent.Model = value return oldModel, nil } - } return rt } diff --git a/pkg/agent/loop_test.go b/pkg/agent/loop_test.go index cdf2bacda..d8df0c543 100644 --- a/pkg/agent/loop_test.go +++ b/pkg/agent/loop_test.go @@ -871,7 +871,6 @@ func TestHandleCdCommand_SymlinkEscape(t *testing.T) { } } - func TestTargetReasoningChannelID_AllChannels(t *testing.T) { tmpDir, err := os.MkdirTemp("", "agent-test-*") if err != nil { diff --git a/pkg/commands/cmd_mode.go b/pkg/commands/cmd_mode.go index 4631392c4..34c787401 100644 --- a/pkg/commands/cmd_mode.go +++ b/pkg/commands/cmd_mode.go @@ -51,7 +51,9 @@ func hipicoCmnd() Definition { } } if msg == "" { - return req.Reply("👋 Hi~ What can I help you with?\n\n💡 Examples:\n /hipico what files are in the working directory?\n /hipico what time is it now?\n /hipico what's the progress on the previous task?") + return req.Reply( + "👋 Hi~ What can I help you with?\n\n💡 Examples:\n /hipico what files are in the working directory?\n /hipico what time is it now?\n /hipico what's the progress on the previous task?", + ) } reply, err := rt.RunOneShot(ctx, msg) if err != nil { diff --git a/pkg/commands/runtime.go b/pkg/commands/runtime.go index 51df0b5f5..a817d294f 100644 --- a/pkg/commands/runtime.go +++ b/pkg/commands/runtime.go @@ -24,7 +24,7 @@ type Runtime struct { SetModePico func() string // switches to pico mode, returns status string // Working directory (session-scoped) - GetWorkDir func() string // current working directory for this session + GetWorkDir func() string // current working directory for this session GetWorkspace func() string // agent workspace root // File editing — delegates to the loop's handleEditCommand with proper path resolution