Skip to content

feat: serve organization agent definitions behind fork-agent-definitions - #66

Merged
ibetitsmike merged 8 commits into
mainfrom
mike/custom-agent-types-6b-org-agent-definition-routes
Nov 9, 2026
Merged

ibetitsmike merged 8 commits into
mainfrom
mike/custom-agent-types-6b-org-agent-definition-routes

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

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 same registerForkChatRoutes mount as #65.

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 and enabled, then deletes the definition, and reading or updating it afterwards gives 404.
  • ScopedAPIKeys: a key scoped to organization_skill:delete cannot read the definition but deletes it. A key scoped to organization_skill:update gets 404 on delete.
  • ExperimentOff: 403.
  • Negative controls, run on this test: removing the Everyone grant, the org-index 409 mapping or the enabled pass-through makes the test fail.
  • Negative controls for DELETE: the old read-first DELETE fails the delete-only case, and dropping the read fallback fails the update-only 404.
  • Ran in Colima: both TestFork*AgentDefinitions tests, 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}.

…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.
@ibetitsmike
ibetitsmike added this pull request to stack #67 November 9, 2026 20:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T21:38:25.731828Z c7a1c8b Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum posted this on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 2bf3475dd9

ℹ️ 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".

… mike/custom-agent-types-6b-org-agent-definition-routes
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum posted this on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 6d4f65f338

ℹ️ 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".

Base automatically changed from mike/custom-agent-types-6-agent-definition-routes to main November 9, 2026 21:21
Merged with PR6's head 4a2314c as the base, because #65's squash commit has the same content as PR6.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum posted this on behalf of @ibetitsmike.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum posted this on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: c7a1c8bdd3

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this on behalf of @ibetitsmike.

Closing and reopening only to make GitHub recompute the merge ref against current main (0b00d9fd1e) and run fork-ci on it. The head is unchanged.

@ibetitsmike ibetitsmike closed this Nov 9, 2026
@ibetitsmike ibetitsmike reopened this Nov 9, 2026
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this again on behalf of @ibetitsmike.

The merge ref now points at current main (0b00d9fd1e), but the run started by the first reopen was queued against the old merge ref. This second reopen starts fork-ci on the recomputed merge. The head is unchanged.

@ibetitsmike ibetitsmike closed this Nov 9, 2026
@ibetitsmike ibetitsmike reopened this Nov 9, 2026
@ibetitsmike
ibetitsmike merged commit e8069ca into main Nov 9, 2026
22 of 29 checks passed
@ibetitsmike
ibetitsmike deleted the mike/custom-agent-types-6b-org-agent-definition-routes branch November 9, 2026 22:57
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merge evidence for head c7a1c8bdd32f14143f9aca4ad6d3a19c4fd93323:

  • fork-ci pull_request run 42713856305 passed; its build job checked out Merge c7a1c8bdd3 into 0b00d9fd1e (current main, deployed and healthy at 22:54Z). All checks green.
  • Codex review on this exact head: no major issues. 0 unresolved review threads. Merge state CLEAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant