Repository navigation
feat(turn): list and start agents of every namespace the user may see - #1400
Merged
Merged
Conversation
turn --list asks ListAgents and ListAgentTemplates with no namespace, as klaus-gateway and the Dev Portal do, and pairs each Agent with the AgentTemplate of its own namespace. --template selects among the Agents of every namespace; --namespace limits it to one, and a name with Agents in more than one namespace is refused without it. The Session is started with the agentRef of the selected Agent's own namespace. Part of giantswarm/giantswarm#39704
… name turn's namespace startTurnSession holds the select-then-start step of turn, so a test sees the start_session arguments. AGENTS.md and docs/agents.md name turn as the one lab path that passes another namespace than kagent.
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.
Part of giantswarm/giantswarm#39704
Problem
agentlab turncould reach thekagentnamespace only: its roster askedListAgentsandListAgentTemplatesforkagent, and it started every Session with an agentRef fixed tokagent. The manual test of the platform public namespace (slice 5 of giantswarm/giantswarm#39639) needs one Session turn inpublic-agents, andturncould not start one there (giantswarm/giantswarm#39702, comment of 2026-12-02).Change
turn --listasksListAgentsandListAgentTemplateswith no namespace, as klaus-gateway and the Dev Portal do. The kagent API lists every namespace the caller may list for an empty namespace. Each line keeps<namespace>/<name>.templateRefis a local reference, so each Agent pairs with the template of its own namespace only.--template <name>selects among the Agents of every namespace by the same rules as before. The new flag--namespace <ns>keeps the Agents of one namespace. A name with Agents in more than one namespace is refused without--namespace, and the refusal names the namespaces. The refusal comes before--harnessor the readiness can pick one.start_sessionwith the selected Agent's own namespace.--session,--delete,--keep,--share-withand--suspendwork by Session id, so they work in every namespace.--namespacewith--list,--sessionor--deleteis refused.roster(),listAgents,listTemplatesandagentRef(name)do not change, so a2a-test and the other proofs keep their behavior. The template index is shared;findListingstays correct with it.start_sessiontakesnamespaceonly for its own platform namespaces (kagent, andpublic-agentswhere the chart has it). For an organization's namespace it refuses and names the organization. Soturnlists an organization's agents but cannot start a Session of one.turnhelp text,docs/cli.md,docs/agents.mdandAGENTS.md.Tests
TestRosterListingsOfEveryNamespace: the roster through the fake controller listskagent,public-agentsand an organization namespace, and a template name in two namespaces gives each Agent the display name of its own namespace.TestSelectAgentAcrossNamespaces: a template name in two namespaces is refused without--namespace(also with--harness), and chosen with it; an inline Agent ofpublic-agentsis chosen by its name.TestStartTurnSessionInTheAgentsNamespace:start_sessiongetsnamespace: public-agentsfor the Agent chosen there, while an Agent of the same name is inkagent.go build ./...,go test ./...and golangci-lint (GOOS=linux, 0 issues) ran. On this macOS host five tests fail onmainand on this branch alike (shell differences):TestBrowserProtocolCommand,TestGitPauseAndResumeCommands,TestMeasureBuildDownloadsDependencies,TestMeasureBuildNotAvailable,TestSessionDirectoryProbeReadsOnlySelectedIDs.Review
AGENTS.mdanddocs/agents.mdstill said the lab passesnamespaceonly forkagent; they now nameturnas the exception.turnsends tostart_session;startTurnSessionholds that step andTestStartTurnSessionInTheAgentsNamespacechecks it.The second reviewer found nothing to fix.