Resolve agent kind name collisions with kind-qualified DB ids and per-kind API routes#2246
Draft
iplay88keys wants to merge 8 commits into
Draft
Resolve agent kind name collisions with kind-qualified DB ids and per-kind API routes#2246iplay88keys wants to merge 8 commits into
iplay88keys wants to merge 8 commits into
Conversation
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
…kind-qualified-ids Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
|
Warning Testing pausedMonthly snapshot limit reached. Update your plan for additional snapshots and to resume testing. |
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
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.
Description
An
Agent,SandboxAgent, andAgentHarnesssharing anamespace/namecurrently overwrite each other's row in the sharedagenttable (last reconcile wins, no error) and resolve interchangeably on every surface that addresses agents bynamespace/name. This PR gives each kind a distinct identity in the database and resolves kind from per-kind API routes.Database identity
ns__NS__name).SandboxAgentandAgentHarnessrows are kind-qualified:sandboxagents__NS__ns__NS__name,agentharnesses__NS__ns__NS__name. The prefixes mirror the API route resources.000007re-keys existing sandbox/harness rows and their sessions. The down migration deletes the kind-qualified rows and their sessions/events outright (experimental data carries no rollback guarantee); this keeps the up migration re-runnable after a 0.9.x rollback window recreates bare rows. Normal-agent rows are untouched, so a 0.10 → 0.9.x rollback leaves normal agents fully functional; kind-qualified rows are inert under 0.9.x until the down migration is run (agent lists are built from Kubernetes, not the DB).utils.AgentDBID/ParseAgentDBID/QualifiedAgentRefare the only places that know the prefix format.API routes
GET/PUT/DELETE /api/agents...andGET /api/sessions/agent/{ns}/{name}resolve as kindAgentonly, exactly as before this PR. NogroupKindquery parameter or body field anywhere./api/sandboxagents/{ns}/{name},/api/agentharnesses/{ns}/{name}) already existed; this PR adds the missing list routes (GET /api/sandboxagents,GET /api/agentharnesses) and per-kind session lists (GET /api/{sandboxagents,agentharnesses}/{ns}/{name}/sessions).agent_refaccepts kind-qualified values (sandboxagents/ns/name,agentharnesses/ns/name); a barens/namestill means Agent, so every existing payload keeps its meaning.UI
/sandbox-agents/[ns]/[name]/chat; kind rides in the path and survives navigation.agent_refvalues viasessionAgentRefFor.Agent-as-tool names
RemoteAgentConfig.Nameis now kind-qualified for sandbox tool agents, so a parent referencing both anAgentand aSandboxAgentwith the same name gets two distinct tools. Agents keep the historical bare name.Behavior changes visible to existing clients
GET /api/agents(merged list) returns kind-qualifiedidvalues forSandboxAgent/AgentHarnessentries.Agententries are identical to before.SandboxAgentused as an agent tool gets a new tool name after upgrade; system prompts addressing the old bare name need updating.Rollback and backwards compatibility
Normal
Agentresources have full rollback support;SandboxAgent/AgentHarnessare experimental and exempt. Concretely:Agent, including error bodies (the delete 404 body deliberately matches the previous release). The only value-level changes old clients can observe are listed under "Behavior changes" above, and both are confined to the experimental kinds.Out of scope
list_agents/invoke_agentand the A2A client registry remain kind-blind; fix(mcp): include SandboxAgents in MCP agent listing #2204 covers both.kagentCLI (agent get,invoke) address kindAgentonly, matching the frozen legacy routes.AgentHarnesssharing a name with anAgentis not reachable in chat (tracked as a follow-up).