-
Notifications
You must be signed in to change notification settings - Fork 409
Add subagent configuration UI #2095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf CI / validate (pull_request).
|
| if (subagent.name.trim()) { | ||
| const subagentMcpMap: Record<string, { id: string }> = {}; | ||
| for (const serverId of subagent.selectedMcpServers) { | ||
| subagentMcpMap[serverId] = create(AIAgent_MCPServerSchema, { id: serverId }); | ||
| } | ||
|
|
||
| subagentsMap[subagent.name.trim()] = create(AIAgent_SubagentSchema, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's trim the subagent name and declare a new variable to reuse in the map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Trimmed name once and reused variable.
76f01b3 to
3f9cc5f
Compare
Agents now support subagents - specialized delegates that inherit provider/model from parent while maintaining their own system prompt and MCP server access. UI changes: - New SubagentConfigSection component using accordion pattern - Integrated into both create and edit flows - Subagents auto-expand on add for immediate editing - Bidirectional proto map conversion (form array <-> proto map) - Validation: name pattern ^[A-Za-z0-9_-]+$, unique names, min 10 char prompts Each subagent gets: - Unique name (routing key) - Custom system prompt - Filtered MCP server access Proto field 15 (subagents map) now fully wired through UI stack.
Proto changes: - Added description field to Subagent message (field 3, max 256 chars) - Field numbers preserved for backward compatibility UI changes: - Added description textarea to SubagentConfigSection component - Added description field to edit mode in AIAgentConfigurationTab - Added helper text explaining usage: * Parent agent uses description to decide when to invoke subagent * Used for context management - parent provides context when starting subagent * Subagent maintains its own context Wired through full stack: proto -> schema validation -> form components -> proto conversion.
Clicking MCP server card in subagent was incorrectly toggling root agent's checkbox when the same server appeared in both contexts.
Root cause: checkbox IDs were not unique across contexts (root vs subagent). Label htmlFor pointed to first matching ID in DOM, causing cross-context activation.
Fix: Add idPrefix prop to MCPServerCardList to namespace checkbox IDs:
- Root agent: "mcp-server-root-{serverId}"
- Subagents: "mcp-server-subagent-{index}-{serverId}"
Clicking checkbox directly worked because onCheckedChange handler had correct scope. Clicking card/label triggered wrong checkbox via ID collision.
Trim subagent name once and reuse variable to avoid redundant string operations. Improves code clarity and eliminates duplicate trim() calls on same input value.
Edit mode lacked validation, allowing invalid data to reach the backend. Added comprehensive validation matching create mode Zod schema: - Name required, max 64 chars, alphanumeric/hyphen/underscore only - Duplicate name detection (prevents silent data loss in proto map) - System prompt minimum 10 chars - Description max 256 chars (optional) All validation errors surface as toast notifications before save attempt. Prevents backend failures and improves UX.
When tag naming changed from 'service_account_id' to 'rp_cloud_service_account_id' in commit d9e8a31, the detail pages still checked for the old hardcoded key instead of using CLOUD_MANAGED_TAG_KEYS.SERVICE_ACCOUNT_ID constant. This caused service account sections to disappear from both AI agent and MCP server configuration tabs even when service accounts existed. Update both pages to use the constant for tag lookup. This restores visibility of service account metadata and role bindings for operators.
d245619 to
70bd91b
Compare
What
Add UI for configuring subagents in agent creation and edit forms, including proto extension for subagent descriptions. Subagents delegate specialized tasks and inherit provider/model from parent agent.
Fix service account visibility regression on AI agent and MCP server detail pages.
Why
Proto f8aab16 added subagent support but lacked UI implementation. Agents need ability to spawn specialized subagents with custom system prompts, descriptions, and filtered tool access without separate provider/model configuration overhead.
Service account sections disappeared from detail pages after tag key rename in d9e8a31. Pages checked hardcoded 'service_account_id' instead of using CLOUD_MANAGED_TAG_KEYS constant.
Implementation details
Proto changes:
Service account fix: