Repository navigation
feat: let organization members turn off organization skills in chats - #31134
Conversation
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
|
@codex review
|
Codex Review SummaryThis 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: Didn't find any major issues. Hooray! 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
|
2 similar comments
|
@codex review
|
|
@codex review
|
|
Codex Review: Didn't find any major issues. Swish! 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
|
|
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". |
|
UAT finding: skill IDs in the preferences PATCH are checked against the caller's skill access, not the member's
Impact. Low. Nothing leaks and chats stay correct. The dashboard always uses Possible fixes.
Found during remote UAT on PR head
|
e5b7b8e to
ef4cc2c
Compare
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
|
Fixed in a100b41.
|
Add a per-organization setting, members_can_disable_skills (off by
default, audited, changeable by users who can update organization
skills). While it is on, each member can turn individual organization
skills off for their own chats, or turn all of them off. chatd and
read_skill skip the skills a member turned off.
- Migration 000635 adds the organization column and two per-member
tables that cascade on membership and skill deletion.
- GET/PUT /api/experimental/organizations/{org}/skill-settings and
GET/PATCH /api/experimental/organizations/{org}/members/{user}/skill-preferences.
- chatd reads the preferences as the chat owner when it builds the skill
index and loads skill bodies.
76249e0 to
6bb1eaa
Compare
Stack
Organization skills load into every member's Coder Agents chats in their organization, with no way for a member to opt out. This stack adds a per-organization setting that lets members turn them off for their own chats, bottom to top:
/menu, and docsWhat changes
Organizations get
members_can_disable_skills, off by default. Users who can update organization skills change it withPUT /api/experimental/organizations/{organization}/skill-settings, which writes an organization audit entry. Anyone who can read the organization canGETit.While the setting is on, each member saves their own choices with
PATCH /api/experimental/organizations/{organization}/members/{user}/skill-preferences:all_skills_disabled(a master switch that also covers skills created later) andskills, a sparse map from skill ID to on or off.GETreturns the setting, the master switch, anddisabled_skill_ids. The routes follow the personal-settings rules: withoutread_personalorupdate_personalon that user the caller gets 404, a PATCH while the setting is off gets 403, and a key that is not an organization skill that member can read gets a 400 that names the key. The check runs as the member, not the caller, so an owner or user admin editing someone else's choices is held to that member's skills. Turning the setting off keeps the choices but ignores them.Migration 000636 adds the column and two tables keyed by organization membership. Both cascade when the membership goes away, and the per-skill table also cascades when the skill is deleted, so a recreated skill loads by default.
chatd reads the preferences as the chat owner when it builds the skill index and when it loads a body for
read_skillor for a structured skill invocation (#30861). A skill the member turned off is left out of the index, and both loads report it as not found, including later in a running chat. If the preferences cannot be read, turn preparation fails, as it already does when the skill metadata cannot be read.Older migration tests created organizations with
dbgen.OrganizationandGetDefaultOrganization, which now select the new column before it exists, so they insert organizations with raw SQL instead.Review focus
coderd/organizationskillpreferences.goand the five new dbauthz methods (read_personalandupdate_personalon the user,organization_skillupdate for the setting).GetOrganizationSkillMemberPreferencesRow.Excludesis the one rule chatd applies; feat: add organization skill opt-out controls to the dashboard #31135 mirrors it inactiveOrganizationSkills.Testing
read_skill, skill invocations, master switch, a change during a chat). Each new test fails with its code path removed.186c28d81ab, which has the same code except the fix below. It found one issue: two spellings of one skill ID with opposite values stored a random result. The PATCH now rejects every aliased key with a 400. A second run on the stack's top head at the time,718dd6d1bd1, passed: every aliased form returns 400 and stores nothing, and chats leave out a skill the member turned off, including inread_skill./skillinvocations honor the opt-out too. The model's skill index leaves out a skill that is not model-invocable or that the member turned off. Apart from that, the diff is unchanged.