Repository navigation
feat: serve organization agent definitions behind fork-agent-definitions - #66
Conversation
…initions
Add CRUD routes for a member's stored agent definitions under
/api/v2/chats/fork/organizations/{organization}/members/{user}/agent-definitions,
the SDK types and client methods, and the generated API docs. Content is
parsed with workspacesdk.ParseAgentDefinition and the front-matter names the
definition. Writes are not audited.
Part of #7.
Add CRUD routes for organization-tier stored agent definitions under
/api/v2/chats/fork/organizations/{organization}/agent-definitions and the
SDK methods. A new definition grants read to the Everyone group, like a new
organization skill, and the list is filtered by each row's ACL.
Part of #7.
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. |
|
@codex review
|
…erence The routes are gated by an experiment, so mark them with @x-apidocgen skip like the fork chat todo routes.
…es-6-agent-definition-routes
|
Codex Review: Didn't find any major issues. Keep them coming! 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". |
… mike/custom-agent-types-6b-org-agent-definition-routes
|
@codex review
|
|
Codex Review: Didn't find any major issues. 👍 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". |
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09e7e67aff
ℹ️ 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".
|
@codex review
|
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
Closing and reopening only to make GitHub recompute the merge ref against current main ( |
The merge ref now points at current main ( |
Merge evidence for head
|
Part of #7
Follows #65 (merged), which added the user tier. Adds the organization-tier routes for stored agent definitions behind
fork-agent-definitions. #69 resolves stored rows into the spawn catalog. #71 adds the org ACL routes, and PR9 the project tier.Routes
/api/v2/chats/fork/organizations/{organization}/agent-definitions: GET list, POST create, and GET, PATCH and DELETE on/{agentDefinition}, in the sameregisterForkChatRoutesmount as #65.postOrganizationSkill. Every member can read a new definition until an ACL route (PR8) narrows it.fetchWithPostFilter, so it holds only the rows the caller can read.ResourceOrganizationSkill.InOrgplus the row ACLs, from feat(coderd/database): store agent definitions for users and organizations #62).Tests
TestForkOrganizationAgentDefinitions/Enabled: an org admin creates a definition, and a duplicate gives 409. A plain member lists and reads it through the Everyone grant but gets 403 on create, update and delete. The admin updates the content andenabled, then deletes the definition, and reading or updating it afterwards gives 404.ScopedAPIKeys: a key scoped toorganization_skill:deletecannot read the definition but deletes it. A key scoped toorganization_skill:updategets 404 on delete.ExperimentOff: 403.enabledpass-through makes the test fail.TestFork*AgentDefinitionstests,TestForkChatRoutes,TestEndpointsDocumented,TestEnterpriseEndpointsDocumented,TestSwaggerParametersValid,TestSDKFieldsFormatted,go build ./coderd/... ./enterprise/... ./codersdk/..., and golangci-lint (no findings in the changed files).Size
362 non-generated lines: 199 handlers, 38 SDK, 110 tests, 11 routes and 4 shared-helper lines. The rest is generated Swagger. The routes are skipped from the published API reference with
@x-apidocgen {"skip": true}.