Repository navigation
feat: share organization agent definitions with members and groups - #175
Conversation
Add GET /api/v2/chats/fork/organizations/{organization}/agent-definitions/{agentDefinition}/acl/available,
which lists the organization members and groups an organization agent
definition can be shared with. It authorizes share on the definition like
the existing ACL routes, so other callers and unknown names get 404.
Add a Share row action to the organization agent definitions page for
viewers who can share organization skills. It opens an "Agent definition
permissions" dialog built on ResourceSharingDialog and returns focus to the
row menu on close. Personal definitions do not offer Share.
…s in the pstack adapter
…anage permissions like the other sharing flows
|
@codex review
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
… load error states and trim restating JSDoc
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da3392ab1f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… refetched ACL and close the sharing dialog when the organization changes
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d17564cbe1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…the sharing dialog stops reading the old organization's ACL and refresh the adapter's source references
|
@codex review
|
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Merge evidence for head
|
) * feat: share organization agent definitions with members and groups Add GET /api/v2/chats/fork/organizations/{organization}/agent-definitions/{agentDefinition}/acl/available, which lists the organization members and groups an organization agent definition can be shared with. It authorizes share on the definition like the existing ACL routes, so other callers and unknown names get 404. Add a Share row action to the organization agent definitions page for viewers who can share organization skills. It opens an "Agent definition permissions" dialog built on ResourceSharingDialog and returns focus to the row menu on close. Personal definitions do not offer Share. * docs: describe sharing organization agent definitions from AI settings in the pstack adapter * refactor(site/src/pages): label the agent definition sharing action Manage permissions like the other sharing flows * test(site/src): cover the agent definition sharing dialog's empty and load error states and trim restating JSDoc * fix(site/src/pages/AISettingsPage/ForkAgentDefinitionsPage): edit the refetched ACL and close the sharing dialog when the organization changes * test(site/src/pages/AISettingsPage/ForkAgentDefinitionsPage): assert the sharing dialog stops reading the old organization's ACL and refresh the adapter's source references
Part of #75.
Lets organization admins choose which organization members and groups can use an organization agent definition, from the AI settings Agent definitions page, behind the
fork-agent-definitionsexperiment. It mirrors the organization Skills sharing flow.GET /api/v2/chats/fork/organizations/{organization}/agent-definitions/{agentDefinition}/acl/availablereturns the organization's users and groups that can be granted access (codersdk.ACLAvailable), using the samewriteOrganizationACLAvailablehelper as skills, MCP servers and models. It authorizes like the existing ACL GET and PATCH from feat: share organization agent definitions behind fork-agent-definitions #71 (share permission on the definition), so a member without that permission and an unknown name get 404. It is registered on the existing inlineorgAgentDefinitionsrouter, carries a full Swagger block (skipped from the markdown docs like its neighbors), and gets acodersdkclient method.ForkOrganizationAgentDefinitionSharingDialogis built on the sharedResourceSharingDialog,ACLPrincipalAutocompleteandaclSharing, likeOrganizationSkillSharingDialog. Saving marks the ACL, the list and the definition's detail stale.Tests: a coderd subtest checks that an org admin gets a known user and group from
/acl/available, that a member without share permission and an unknown name get 404, and that after a group gets read and Everyone is dropped, a group member can read the definition and a non-member cannot. Vitest covers the dialog (it saves only changed entries, shows save errors, and edits the refetched ACL rather than a cached one), the mutation's cache effects, an admin opening Manage permissions with focus returning to the row menu on cancel, and the dialog closing without a save when Back or Forward changes the organization. Stories show the dialog with a group row and a user row, with no permissions, and with a load error and a save error, plus the page's row menu with and without share permission.Checks: Go
TestForkOrganizationAgentDefinitions,TestForkChatRoutes,TestEndpointsDocumentedandTestSwagger; sitepnpm lint(biome, oxlint, tsc, knip, circular deps, compiler), unit tests (92) and story tests (35) pass locally.UAT on a branch server built from
6d0ebe28fb(Fork ops), with local Vite at the same head proxying to it. The row action was still labeled Share then; only the label has changed since./acl/available, and saves. The ACL then holds that user and no groups./acl/availablewith 404. A plain member is denied the page and gets 404 from/acl/available.Custom groups weren't live-tested because no licensed UAT server is available, so the server's only group was Everyone. The coderd test and the
GroupAndUserstory cover sharing with a custom group.