fix(agent): code format fixed

This commit is contained in:
sky5454 2026-04-19 09:14:27 +08:00
parent b1d947e337
commit 11f9d962ea
7 changed files with 10 additions and 13 deletions

View file

@ -629,9 +629,9 @@ toolLoop:
if len(exec.pendingMessages) > 0 { if len(exec.pendingMessages) > 0 {
logger.InfoCF("agent", "Pending steering after partial tool execution; continuing turn", logger.InfoCF("agent", "Pending steering after partial tool execution; continuing turn",
map[string]any{ map[string]any{
"agent_id": ts.agent.ID, "agent_id": ts.agent.ID,
"pending_count": len(exec.pendingMessages), "pending_count": len(exec.pendingMessages),
"allResponsesHandled": exec.allResponsesHandled, "allResponsesHandled": exec.allResponsesHandled,
}) })
return ToolControlContinue return ToolControlContinue
} }

View file

@ -27,7 +27,6 @@ func (p *Pipeline) Finalize(
// But still check for hard abort - if requested, abort the turn. // But still check for hard abort - if requested, abort the turn.
if exec.allResponsesHandled { if exec.allResponsesHandled {
if ts.hardAbortRequested() { if ts.hardAbortRequested() {
turnStatus = TurnEndStatusAborted
return al.abortTurn(ts) return al.abortTurn(ts)
} }
ts.setPhase(TurnPhaseCompleted) ts.setPhase(TurnPhaseCompleted)
@ -46,7 +45,6 @@ func (p *Pipeline) Finalize(
ts.recordPersistedMessage(finalMsg) ts.recordPersistedMessage(finalMsg)
ts.ingestMessage(turnCtx, al, finalMsg) ts.ingestMessage(turnCtx, al, finalMsg)
if err := ts.agent.Sessions.Save(ts.sessionKey); err != nil { if err := ts.agent.Sessions.Save(ts.sessionKey); err != nil {
turnStatus = TurnEndStatusError
al.emitEvent( al.emitEvent(
EventKindError, EventKindError,
ts.eventMeta("runTurn", "turn.error"), ts.eventMeta("runTurn", "turn.error"),
@ -55,7 +53,7 @@ func (p *Pipeline) Finalize(
Message: err.Error(), Message: err.Error(),
}, },
) )
return turnResult{}, err return turnResult{status: TurnEndStatusError}, err
} }
} }

View file

@ -204,7 +204,6 @@ func (al *AgentLoop) runTurn(ctx context.Context, ts *turnState, pipeline *Pipel
return pipeline.Finalize(ctx, turnCtx, ts, exec, turnStatus, finalContent) return pipeline.Finalize(ctx, turnCtx, ts, exec, turnStatus, finalContent)
} }
} }
} }
if ts.hardAbortRequested() { if ts.hardAbortRequested() {