Repository navigation
Conversation
…cts experiment Adds a lightweight chat_projects table and a nullable chats.project_id binding so agent chats can be grouped inside an organization-scoped project. Chats stay independent by default; deleting a project detaches its chats instead of deleting them. Backend: chat_project RBAC resource (org members read/create, creators and org admins update/delete), audited CRUD under /api/experimental/chats/projects, project_id on chat create/update and list filter, codersdk client methods. Frontend: experiment-gated Projects sidebar section with create/edit/ delete dialogs, /agents/projects/:projectId page, new-chat-in-project via ?project=, and a Move to project action in the chat menus.
Single-project responses previously scanned the organization's project list to recover chat_count. A dedicated count query shares the list predicate, and the converter now requires the count so no response can silently report zero.
Silently dropping project_id returned every chat as if it were the project's contents. The list now fails the same way create and update do.
# Conflicts: # docs/reference/api/schemas.md
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75a5667817
ℹ️ 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".
| '[ | ||
| { | ||
| "label": "Open project", | ||
| "url": "{{base_url}}/agents/projects/{{.Labels.project_id}}" |
There was a problem hiding this comment.
Point the notification at an existing project route
Every direct share sends this action, but the frontend router only defines /agents, settings routes, and /agents/:agentId; there is no /agents/projects/:projectId route anywhere in the repository. Selecting Open project therefore lands on an unmatched route, so every project-share notification has a broken call to action. Use a route or query parameter the Agents page already handles, or add the corresponding route.
Useful? React with 👍 / 👎.
| oldProject = current | ||
| oldProject.UserACL = maps.Clone(current.UserACL) |
There was a problem hiding this comment.
Clone the group ACL before mutating it
When GroupRoles adds or removes an entry, oldProject.GroupACL and current.GroupACL still reference the same map because only UserACL is cloned. The mutation therefore updates the audit request's old snapshot before aReq.New is assigned, causing the tracked group_acl diff to omit the change. Clone current.GroupACL into oldProject.GroupACL as well.
Useful? React with 👍 / 👎.
| } | ||
| } | ||
|
|
||
| validErrs := acl.Validate(ctx, api.Database, ChatProjectACLUpdateValidator(req)) |
There was a problem hiding this comment.
Reject ACL principals outside the project organization
When an owner supplies an existing user or group UUID from another organization, acl.Validate only checks global existence, so the foreign principal is stored. A foreign direct user is then notified about a project they cannot access, while a foreign group can grant access to its members who also belong to the project's organization because the RBAC policy matches the group UUID without validating the group's organization. Validate user membership and group ownership against project.OrganizationID, as the chat-model and MCP ACL handlers do.
Useful? React with 👍 / 👎.
| delete(current.UserACL, id) | ||
| continue | ||
| } | ||
| current.UserACL[id] = database.ChatACLEntry{Permissions: db2sdk.ChatProjectRoleActions(role)} |
There was a problem hiding this comment.
Canonicalize UUID keys before storing ACL entries
When the request uses a valid noncanonical UUID spelling, such as uppercase hex, validation succeeds but the raw string is persisted as the ACL key. RBAC looks up the entry using the subject's canonical uuid.String(), so that user or group is reported as shared and may receive a notification but cannot read the project. Canonicalize both role maps before applying them and reject duplicate spellings that collapse to the same UUID.
Useful? React with 👍 / 👎.
|
|
||
| var oldProject database.ChatProject | ||
| err := api.Database.InTx(func(tx database.Store) error { | ||
| current, err := tx.GetChatProjectByIDForUpdate(ctx, project.ID) |
There was a problem hiding this comment.
Lock the project without requiring read permission
When an actor has chat_project:share but not chat_project:read, such as a low-level scoped API key or custom role, the handler's share authorization succeeds but this dbauthz getter uses the generic fetch wrapper and performs an additional read authorization, causing the transaction to return 404. This makes the newly added share action unusable independently; fetch the locked row under restricted system access after the handler check and rely on UpdateChatProjectACLByID to reauthorize sharing against the current row.
Useful? React with 👍 / 👎.
Sharing (#29597) is parked; memory permissions follow the project owner only and the memory migration returns to 000599.
Sharing (#29597) is parked; the sharing popover is chat-only again.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. 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". |
|
@f0ssel Can we make it so that a project can shared while its being created? Also, It could be useful to share it with the entire organization the project is being created in. |
user_acl/group_aclonchat_projects, singlereadrole,GET/PATCH /api/experimental/chats/projects/{project}/acl.CODER_DISABLE_CHAT_SHARINGdisables project sharing too.Chat Project Sharednotification for directly added users, auditedchat_projectACL writes,chat_project:shareAPI key scope.Generated with Coder Agents on behalf of @f0ssel.