From 11f9d962ea4100d1c49d9940c8a7ca33059962f6 Mon Sep 17 00:00:00 2001 From: sky5454 Date: Sun, 19 Apr 2026 09:14:27 +0800 Subject: [PATCH] fix(agent): code format fixed --- pkg/agent/pipeline.go | 2 +- pkg/agent/pipeline_execute.go | 8 ++++---- pkg/agent/pipeline_finalize.go | 6 ++---- pkg/agent/pipeline_llm.go | 2 +- pkg/agent/pipeline_setup.go | 2 +- pkg/agent/turn_coord.go | 1 - pkg/agent/turn_state.go | 2 +- 7 files changed, 10 insertions(+), 13 deletions(-) diff --git a/pkg/agent/pipeline.go b/pkg/agent/pipeline.go index c8abfe595..c4b9ec3af 100644 --- a/pkg/agent/pipeline.go +++ b/pkg/agent/pipeline.go @@ -37,4 +37,4 @@ func NewPipeline(al *AgentLoop) *Pipeline { Steering: al.steering, al: al, } -} \ No newline at end of file +} diff --git a/pkg/agent/pipeline_execute.go b/pkg/agent/pipeline_execute.go index 26e264cdf..0cf622971 100644 --- a/pkg/agent/pipeline_execute.go +++ b/pkg/agent/pipeline_execute.go @@ -629,9 +629,9 @@ toolLoop: if len(exec.pendingMessages) > 0 { logger.InfoCF("agent", "Pending steering after partial tool execution; continuing turn", map[string]any{ - "agent_id": ts.agent.ID, - "pending_count": len(exec.pendingMessages), - "allResponsesHandled": exec.allResponsesHandled, + "agent_id": ts.agent.ID, + "pending_count": len(exec.pendingMessages), + "allResponsesHandled": exec.allResponsesHandled, }) return ToolControlContinue } @@ -691,4 +691,4 @@ toolLoop: "agent_id": ts.agent.ID, "iteration": iteration, }) return ToolControlContinue -} \ No newline at end of file +} diff --git a/pkg/agent/pipeline_finalize.go b/pkg/agent/pipeline_finalize.go index 8bb787aba..43d44099a 100644 --- a/pkg/agent/pipeline_finalize.go +++ b/pkg/agent/pipeline_finalize.go @@ -27,7 +27,6 @@ func (p *Pipeline) Finalize( // But still check for hard abort - if requested, abort the turn. if exec.allResponsesHandled { if ts.hardAbortRequested() { - turnStatus = TurnEndStatusAborted return al.abortTurn(ts) } ts.setPhase(TurnPhaseCompleted) @@ -46,7 +45,6 @@ func (p *Pipeline) Finalize( ts.recordPersistedMessage(finalMsg) ts.ingestMessage(turnCtx, al, finalMsg) if err := ts.agent.Sessions.Save(ts.sessionKey); err != nil { - turnStatus = TurnEndStatusError al.emitEvent( EventKindError, ts.eventMeta("runTurn", "turn.error"), @@ -55,7 +53,7 @@ func (p *Pipeline) Finalize( Message: err.Error(), }, ) - return turnResult{}, err + return turnResult{status: TurnEndStatusError}, err } } @@ -76,4 +74,4 @@ func (p *Pipeline) Finalize( status: turnStatus, followUps: append([]bus.InboundMessage(nil), ts.followUps...), }, nil -} \ No newline at end of file +} diff --git a/pkg/agent/pipeline_llm.go b/pkg/agent/pipeline_llm.go index 6516302bc..c7ef3353c 100644 --- a/pkg/agent/pipeline_llm.go +++ b/pkg/agent/pipeline_llm.go @@ -517,4 +517,4 @@ func (p *Pipeline) CallLLM( } return ControlToolLoop, nil -} \ No newline at end of file +} diff --git a/pkg/agent/pipeline_setup.go b/pkg/agent/pipeline_setup.go index 7dfd1286e..e6ead1012 100644 --- a/pkg/agent/pipeline_setup.go +++ b/pkg/agent/pipeline_setup.go @@ -113,4 +113,4 @@ func (p *Pipeline) SetupTurn(ctx context.Context, ts *turnState) (*turnExecution exec.usedLight = usedLight return exec, nil -} \ No newline at end of file +} diff --git a/pkg/agent/turn_coord.go b/pkg/agent/turn_coord.go index 3756ad6e5..8a9ca82d3 100644 --- a/pkg/agent/turn_coord.go +++ b/pkg/agent/turn_coord.go @@ -204,7 +204,6 @@ func (al *AgentLoop) runTurn(ctx context.Context, ts *turnState, pipeline *Pipel return pipeline.Finalize(ctx, turnCtx, ts, exec, turnStatus, finalContent) } } - } if ts.hardAbortRequested() { diff --git a/pkg/agent/turn_state.go b/pkg/agent/turn_state.go index ed0fb575f..f2616cda1 100644 --- a/pkg/agent/turn_state.go +++ b/pkg/agent/turn_state.go @@ -642,4 +642,4 @@ func turnStateFromContext(ctx context.Context) *turnState { // TurnStateFromContext retrieves turnState from context (exported for tools) func TurnStateFromContext(ctx context.Context) *turnState { return turnStateFromContext(ctx) -} \ No newline at end of file +}