feat(ui): add agent management under Providers feature flag#1625
feat(ui): add agent management under Providers feature flag#1625PetrBulanek merged 4 commits intomainfrom
Conversation
Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com>
8911a69 to
f4fe3a7
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request successfully moves the agent management functionality behind the Providers feature flag. The changes in the React components correctly apply this logic to hide UI elements like the 'Add Agent' button and the 'Agent providers' settings tab based on the feature flag and user role. The documentation and example environment file have also been updated accordingly.
I have a couple of suggestions regarding the ordering of feature flags in the documentation and example configuration file to improve consistency across the codebase. Overall, the changes are well-implemented and align with the goal of making agent management a configurable feature.
apps/agentstack-ui/.env.example
Outdated
|
|
||
| # All feature flags default to false | ||
| FEATURE_FLAGS='{"LocalSetup":true,"MCP":true,"Providers":true,"ProviderBuilds":true,"Variables":true,"Connectors":false}' | ||
| FEATURE_FLAGS='{"Connectors":false,"LocalSetup":false,"MCP":false,"Providers":false,"ProviderBuilds":false,"Variables":false}' |
There was a problem hiding this comment.
The order of feature flags in the JSON string is not alphabetical, with Providers appearing before ProviderBuilds. This is inconsistent with their definition in apps/agentstack-ui/src/utils/feature-flags.ts. For better consistency and maintainability, please sort the keys alphabetically.
FEATURE_FLAGS='{"Connectors":false,"LocalSetup":false,"MCP":false,"ProviderBuilds":false,"Providers":false,"Variables":false}'
apps/agentstack-ui/README.md
Outdated
| - **Providers** – Shows the “Agent providers” tab in Settings and allows admin/developer users to manage agents, including adding agents using container image URLs and removing agents. | ||
| - **ProviderBuilds** – Adds the option to import agents directly from a GitHub repository. *Requires `Providers` to also be enabled.* | ||
| - **Connectors** – Shows the “Connectors” tab in Settings and lets you list, connect, disconnect, and remove registered connectors. |
There was a problem hiding this comment.
The feature flags in this list are not sorted alphabetically, which is inconsistent with their definition in apps/agentstack-ui/src/utils/feature-flags.ts. To improve consistency and maintainability, please reorder this part of the list alphabetically.
| - **Providers** – Shows the “Agent providers” tab in Settings and allows admin/developer users to manage agents, including adding agents using container image URLs and removing agents. | |
| - **ProviderBuilds** – Adds the option to import agents directly from a GitHub repository. *Requires `Providers` to also be enabled.* | |
| - **Connectors** – Shows the “Connectors” tab in Settings and lets you list, connect, disconnect, and remove registered connectors. | |
| - **Connectors** – Shows the “Connectors” tab in Settings and lets you list, connect, disconnect, and remove registered connectors. | |
| - **ProviderBuilds** – Adds the option to import agents directly from a GitHub repository. *Requires `Providers` to also be enabled.* | |
| - **Providers** – Shows the “Agent providers” tab in Settings and allows admin/developer users to manage agents, including adding agents using container image URLs and removing agents. |
Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com>
| const action = useMemo( | ||
| () => | ||
| isAdminOrDev | ||
| featureFlags.Providers && isAdminOrDev |
There was a problem hiding this comment.
Would be nice to extract this into some feature flags / business logic ruleset hook to make it DRY. I can easily see someone missing either of the rules.
There was a problem hiding this comment.
Good idea, I've updated it.
…flag Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com>
| () => | ||
| ITEMS.filter(({ featureName }) => { | ||
| if (featureName === 'Providers') { | ||
| return featureFlags[featureName] && isAdminOrDev; |
There was a problem hiding this comment.
I think useCanManageProviders can be used here as well.
There was a problem hiding this comment.
I missed that, good catch! :-)
…eature flag Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com>
Summary
Removes the “Add Agent” button from the GUI for all roles to reduce confusion and keep the interface focused on end-user actions, with the CLI remaining the primary method for managing agents. Agent management is actually not removed from the UI entirely - it is now hidden behind the
Providersfeature flag.Linked Issues
Closes: #1563
Documentation