stop hard-coding "root" as the default agent name#2576
Merged
dgageot merged 1 commit intodocker:mainfrom Apr 28, 2026
Merged
Conversation
rumpl
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the remaining places that hard-coded
"root"as the default/initial agent name and routes every "default agent" lookup through a single helper.What changed
team.Team.AgentOrDefault(name)method: returns the agent identified byname, falling back toteam.DefaultAgent()whennameis empty. Centralizes the "empty means default" pattern that was being open-coded in many places.--agentflag now default to""(the empty string) instead of"root". The flag is resolved against the team viaAgentOrDefault, so any agent name works.t.Agent("root")/WithCurrentAgent("root")call site replaced with a resolved name (AgentOrDefault/DefaultAgent) —cmd/root/run.go,pkg/a2a/adapter.go,pkg/acp/agent.go,pkg/server/server.go,pkg/server/session_manager.go.pkg/runtime/remote_runtime.go:currentAgentnow defaults to""(server-side resolves),RunStreamno longer special-cases the literal"root", and async.Once-cachedresolvedAgent(ctx)helper keepsCurrentAgentName()cheap on hot paths.cmd/root/completion.go: shell completion now mirrorsteam.DefaultAgent()(prefer"root"if present, otherwise the first agent declared) so completion stays in sync with what the runtime would actually run.Team.DefaultAgentandTeam.AgentOrDefaultcovering the empty-team / has-root / no-root / explicit-name / unknown-name paths.Backwards compatibility
team.DefaultAgent()keeps preferring an agent literally named"root"when one exists, so any existing config / API consumer that relied on that name continues to behave identically. Configs without arootagent now resolve to the first declared agent instead of failing.