Skip to content

feat: turn off a plugin pack for one chat - #241

Merged
ibetitsmike merged 5 commits into
mainfrom
mike/chat-plugin-pack-disable
Nov 12, 2026
Merged

ibetitsmike merged 5 commits into
mainfrom
mike/chat-plugin-pack-disable

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of Mike.

With the fork-plugin-packs experiment on, a chat owner can now turn off a plugin pack for one chat, even when the chat's project enables it. A pack turned off on a chat stays off for that chat and its subagents, and turning it off wins over every enablement.

  • New chatdmig node chat_excluded_plugin_packs (requires the enablement node). Rows cascade with the chat, the organization and the pack. A trigger rejects a row whose chat is in another organization than the pack.
  • Queries InsertChatExcludedPluginPack, DeleteChatExcludedPluginPack and GetExcludedPluginPacksByChatID, with dbauthz (the same chat update and read checks as the chat's own enablements) and dbmetrics wrappers.
  • Routes GET /api/v2/chats/fork/{chat}/excluded-plugin-packs and PUT/DELETE .../{pluginPack}, plus the SDK methods ForkChatExcludedPluginPacks, ExcludeForkChatPluginPack and IncludeForkChatPluginPack. A pack in another organization answers 404.
  • enabledPacks in chatd/fork_plugin_gate.go drops every pack turned off on the chat or any ancestor. If that lookup fails it returns no packs, so the gate fails closed. Resource filtering, cleanup, the materializer and the agent catalog all use enabledPacks, so they follow it.
  • ARCHITECTURE.md gets one TODO for the new table.

The composer toggle comes in a follow-up PR stacked on this one.

Validation on 04879c5 (this head adds only the ARCHITECTURE.md TODO):

  • In a container with Postgres: chatdmig check, gofmt, build of coderd/enterprise/codersdk, vet, TestForkQuerier, TestSQLCSchemaOrder, TestFilterPackResources, TestForkPluginPackEnablement, TestForkChatRoutes, EndpointsDocumented and TestSwagger. All pass.
  • Negative control: when enabledPacks ignores exclusions, TestFilterPackResources/Enablement fails.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 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-12T12:14:54.092687Z 68c95af 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.

@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: 68c95af7ec

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

Comment thread coderd/x/chatd/ARCHITECTURE.md Resolved
Comment thread coderd/x/chatd/fork_plugin_gate.go Resolved
Comment thread coderd/fork_plugin_pack_enablement.go Resolved
@ibetitsmike
ibetitsmike merged commit 6f54e78 into main Nov 12, 2026
10 checks passed
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum merged this PR on behalf of @ibetitsmike.

Merge gates on head 68c95af:

  • fork-ci run 43215453770 passed, and all check runs on the head passed.
  • Codex review 5874285828 covered this head. Its 1 P1 and 2 P2 findings were declined: the P1 asks for edits to ARCHITECTURE.md, which are the human author's job, and each P2 matches the existing disable or DELETE behavior. 0 review threads are unresolved.
  • Local validation passed, including a negative control (TestFilterPackResources/Enablement failed as expected when broken).
  • The change is backend only. The live UI check is part of the X2 stacked PR's UAT on :3100.
  • The branch is 0 commits behind main.

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