From 38e71b3667a3f24ba80c6e83e7f8b9aed01f43fd Mon Sep 17 00:00:00 2001 From: David Mora Date: Mon, 13 Jul 2026 14:27:30 -0600 Subject: [PATCH] fix(sequentialagent): correct New godoc placement and copy-pasted error string The "New creates a SequentialAgent" doc comment was attached to the seqAgent type after the live-mode changes inserted the type between the comment and func New, leaving New with only an orphaned fragment. Reunite the full doc comment with New and give seqAgent its own comment. Also fix the custom-Run guard error, which reported "LoopAgent" instead of "SequentialAgent" (copy-paste from loopagent; parallelagent names itself correctly). --- agent/workflowagents/sequentialagent/agent.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/agent/workflowagents/sequentialagent/agent.go b/agent/workflowagents/sequentialagent/agent.go index 517a3b16b..c97173bf1 100644 --- a/agent/workflowagents/sequentialagent/agent.go +++ b/agent/workflowagents/sequentialagent/agent.go @@ -28,9 +28,8 @@ import ( "google.golang.org/adk/v2/tool/functiontool" ) -// New creates a SequentialAgent. -// -// SequentialAgent executes its sub-agents once, in the order they are listed. +// seqAgent is the agent returned by New; it augments the base agent with the +// live-mode entry point. type seqAgent struct { agent.Agent *agentinternal.State @@ -41,11 +40,14 @@ func (s *seqAgent) RunLive(ctx agent.InvocationContext) (agent.LiveSession, iter return s.impl.RunLive(ctx) } +// New creates a SequentialAgent. +// +// SequentialAgent executes its sub-agents once, in the order they are listed. // Use the SequentialAgent when you want the execution to occur in a fixed, // strict order. func New(cfg Config) (agent.Agent, error) { if cfg.AgentConfig.Run != nil { - return nil, fmt.Errorf("LoopAgent doesn't allow custom Run implementations") + return nil, fmt.Errorf("SequentialAgent doesn't allow custom Run implementations") } sequentialAgentImpl := &sequentialAgent{}