fix(site): show Manage agents link to organization model admins - #28637
Merged
Conversation
The Agents settings panel gated the Manage agents link on editDeploymentConfig, but the Coder Agents page it links to already admits organization model admins. Gate the link on a new canAccessCoderAgentsSettings helper (deployment edit access or any chat model config access) threaded as a separate prop, leaving isAdmin untouched for API-key visibility and provider queries.
ethanndickson
force-pushed
the
fix/agents-sidebar-manage-link
branch
from
August 26, 2026 13:32
bcc671c to
05e4151
Compare
ibetitsmike
approved these changes
Aug 26, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The Agents settings panel only showed the Manage agents link to users with
editDeploymentConfig, even though the Coder Agents page it links to (/ai/settings/coder-agents) already admits organization model admins, as does the AI settings sidebar. Organization model admins had no way to discover the page from the Agents settings panel.Gate the link on a new
canAccessCoderAgentsSettingshelper (deployment edit access or any chat model config access), threaded as a separatecanManageAgentSettingsprop throughAgentsPageLayout,ChatsSidebar, andSettingsPanel.isAdminis left untouched because it also controls API-key item visibility and the provider configs query.Refs CODAGT-74.
Implementation plan (Coder Agents)
Bug: hidden Manage agents link
Current behavior:
AgentsPageLayout.tsxdefines agents administration aspermissions.editDeploymentConfigand threads it asisAdminthroughChatsSidebar.SettingsPanel.tsxshows Manage agents only whenisAdmin.CoderAgentsPage.tsxalready allows organization model administrators, and fix: move organization model overrides from Models to Coder Agents settings #28473 explicitly intended the page and sidebar entry to support deployment access or organization model access.Design:
canAccessCoderAgentsSettings(permissions)insite/src/modules/permissions/index.ts, defined as deployment edit access orcanAccessAnyChatModelConfig(permissions).canManageAgentSettingsprop throughAgentsPageLayout,ChatsSidebar, andSettingsPanel.isAdmin, because it also controls API-key visibility and provider queries.Tests:
ChatsSidebarstory whereisAdminis false and organization model access is true: the link appears and the API-key item stays hidden.AgentsPageLayoutstory withMockNoPermissionspluseditAnyChatModelConfig: the link appears through the full permission-driven flow.Generated by Coder Agents on behalf of @ethanndickson.