feat(supervisor): multi-agent registry, composition UI, and supervisor runtime#433
Draft
sami-marreed wants to merge 2 commits into
Draft
feat(supervisor): multi-agent registry, composition UI, and supervisor runtime#433sami-marreed wants to merge 2 commits into
sami-marreed wants to merge 2 commits into
Conversation
…r runtime (#101) Adds a multi-agent registry (create/list/delete agents, single or supervisor kind), a supervisor composition screen for adding internal/A2A sub-agents, and wires the supervisor into the live chat runtime end-to-end: - Backend registry: GET/POST /api/agents, DELETE /api/agents/{id} - Manage UI: create/delete agents, Sub-agents panel, plan-approval toggle - Runtime: per-request X-Agent-ID resolution with a built-graph cache, parameterized DynamicAgentGraph supervisor override, and the routing fix that makes TaskAnalyzer actually enter the CugaSupervisor node for a per-agent supervisor (previously gated only on the global settings.supervisor.enabled toggle) - Plan-approval HITL gate reusing the existing interrupt()/ActionResponse path, including a fix for AgentState missing the supervisor_metadata field the resume flow depends on - Chat UI: /chat/:agentId route, agent switcher, X-Agent-ID threaded through postStream and conversation endpoints - CLI: `cuga start manager --seed-supervisor-demo` preloads a CRM/email/ filesystem sub-agent trio + supervisor for local testing - Fixes a silent bug where hyphenated agent ids (crm-agent) produced an invalid delegate_to_crm-agent identifier, breaking both delegation and the plan-approval gate's code-scan matcher - Test-DB isolation: conftest fixtures redirect DB-touching tests to a temp dir instead of the shared local cuga.db a running dev server uses
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Merge origin/main without rebase, keeping supervisor graph cache invalidation alongside main's knowledge reindex helpers, and rebuilding frontend dist artifacts.
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.
Feature
Closes #101
Summary
Adds a multi-agent registry to the manage UI (create/list/delete agents, single or supervisor kind), a supervisor composition screen for adding internal or A2A sub-agents, and wires the supervisor into the live chat runtime end-to-end.
Backend registry
GET/POST /api/agents,DELETE /api/agents/{id}— list/create/delete agents (agents_routes.py)Manage UI
PATCH /api/manage/config/draft/supervisorSupervisor runtime
X-Agent-IDresolution in/streamwith a built-graph cache, invalidated on draft-save/publishDynamicAgentGraphtakes a per-agentsupervisor_agents/supervisor_enabledoverride instead of only reading the globalsettings.supervisor.enabledYAML toggleTaskAnalyzer.should_use_supervisor_modeonly ever checked the global setting, so a per-agent supervisor never actually routed into theCugaSupervisornode at runtime even though the graph was built correctly. Added astate.supervisor_modeoverride (same pattern aslite_mode) thatevent_streamsets when the resolved agent is a supervisor.interrupt()/ActionResponsepath (create_agent_approval_action, already had frontend support in the chat card renderer). Required addingAgentState.supervisor_metadata, which the resume flow depends on but which didn't exist on the outer state.crm-agent, the normal case for any UI-created agent) produceddelegate_to_crm-agent, an invalid Python identifier that parses as subtraction — breaking both delegation itself and the plan-approval gate's code-scan matcher.Chat UI
/chat/:agentIdroute, an agent switcher in the chat header,X-Agent-IDthreaded throughpostStreamand the conversation endpoints (previously hardcoded tocuga-default)CLI
cuga start manager --seed-supervisor-demopreloads a CRM/email/filesystem sub-agent trio + supervisor (draft + published) and provisions their tools, for local testing without manual setupTest infra
tests/unit/conftest.pyandsrc/cuga/sdk_core/tests/conftest.py: autouse fixture that isolates DB-touching tests to a tempDBS_DIRinstead of the shared localcuga.dba running dev server also uses (several tests callreset_config_db(), which previously could delete/corrupt a live server's database)Testing
tests/unit/,src/cuga/sdk_core/tests/,src/cuga/backend/cuga_graph/nodes/cuga_agent_core/tests/) — no regressions vs. the pre-existing baseline (verified viagit stash -udiffing)ruff checkclean on all touched filestsc/webpack build clean (same pre-existing baseline errors, no new ones)