Repository navigation
feat: serve user-tier agent definitions behind fork-agent-definitions - #65
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.
|
@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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afe472c706
ℹ️ 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".
…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
|
1 similar comment
|
@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". |
Main moved to |
Merge evidence for head
|
Part of #7
Adds the user-tier routes for stored agent definitions (scope item 4), behind
fork-agent-definitions. This is the bottom of a stack: PR6b adds the organization tier, PR7 resolves stored rows into the spawn catalog, and PR8 adds org ACL routes, read-time membership and the project tier.Routes
/api/v2/chats/fork/organizations/{organization}/members/{user}/agent-definitions:///{agentDefinition}/{agentDefinition}contentand/orenabled/{agentDefinition}registerForkChatRoutesmount with inlineRequireExperiment,ExtractOrganizationParamandExtractOrganizationMemberParam, so the target user must belong to the organization andmeworks. No upstream route files change.workspacesdk.ParseAgentDefinition, and the front-matter must name the definition, because a stored row has no file name to fall back on. New content in a PATCH must keep the name in the path.coderd/auditandenterprise/audit, so W1 leaves them alone.SDK
codersdk/fork_agent_definitions.gohasForkAgentDefinition,ForkAgentDefinitionMetadata, the create and update requests, and the five user-tier methods on*Client. The routes carry Swagger annotations with@x-apidocgen {"skip": true}, like the fork chat todo routes, socoderd/apidocandtypesGenerated.tsinclude them but the published API reference does not.Tests
TestForkUserAgentDefinitions/Enabled: CRUD throughmeand the username, duplicate and invalid content, update and name mismatch, a missing row, and another member who gets 404 on reads and 403 on writes.TestForkUserAgentDefinitions/ExperimentOff: 403.TestForkUserAgentDefinitions,TestForkChatRoutes,TestEndpointsDocumented,TestEnterpriseEndpointsDocumented,TestSwaggerParametersValid,TestSDKFieldsFormatted, plusgo build ./coderd/... ./enterprise/... ./codersdk/...and golangci-lint oncoderdandcodersdk(no findings in the changed files).Size
503 non-generated lines: 300 handlers, 85 SDK, 106 tests and 12 route lines. The rest is generated API docs and types.