Repository navigation
Conversation
There was a problem hiding this comment.
Round 5 of the chat project delete review: the round 4 fixes hold (several checked by breaking the line and rerunning the test), the onSuccess placement dispute is closed, and this round adds 1 P2, 1 P3, 9 P4, and 2 Nit findings.
Most of these are tests and docs that did not follow the round 4 lock changes: the skill lock mode, the memory writer lock, and the docs that describe them.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
Round 6 of the chat project delete review: the round 5 fixes hold (checked by mutation), the memory lock dispute is closed, and this round adds 1 P2, 4 P4, and 1 Nit, plus one item reopened below.
Reopened: the ConsolidateMemory deleted-project response still has no test (reply on the memory.go:532 thread). If that thread still shows as resolved, it is because unresolving it failed again; the reply is current.
Two of the new findings are in the lock-wait probes of the new race tests, which count waiters from parallel subtests and can let a subtest pass without testing its own lock.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
Round 7 of the chat project delete review: every round 6 finding is verified fixed, most by breaking the fixed line and rerunning its test, and reviewers found no production defects. This round adds 2 P2 comment findings, 2 P4 test gaps, and 1 Nit.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
Round 8 of the chat project delete review: every round 7 finding is verified fixed, the two new 404 tests fail when their branches are removed, and reviewers found no production defects. This round adds 1 P2 test comment finding and 3 P4 cleanups.
🤖 This review was automatically generated with Coder Agents.
There was a problem hiding this comment.
Round 9 is blocked: the head is still 36ba869, the commit reviewed in round 8, and none of the four round 8 threads has a reply, so no reviewers ran.
Needed before the next round, as a fix in this PR or a reply on the thread explaining why not:
coderd/chat_projects_test.go:356(P2, CRF-144): the table comment says "source project" and "the chat is gone too", which are wrong for the unarchive case.coderd/x/chatd/chattool/memory.go:53(P4, CRF-145): thewriteProjectMemoriesdoc does not say what the returnedint64is.coderd/database/querier_test.go:2376(P4, CRF-146):lockWaitCountreturns 0 when its query fails, so a broken probe times out as a locking regression.coderd/exp_chats.go:1736and:2945(P4, CRF-147): theForeignKeyChatsProjectIDcheck is unreachable now that create and move hold the projectFOR SHARE.
No production defects are open.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
Round 10 of the chat project delete review: all four round 8 findings are verified fixed in 6a77bb8, and the affected Postgres and HTTP tests pass. Reviewers found no production defects. This round adds 1 Nit.
Out of scope (needs a ticket or explicit acceptance by a human):
coderd/exp_chats.go:2944: "between the check and the move" does not namevalidateChatProjectSelection, which runs about 200 lines earlier; the comment and its sibling at line 1735 exist at the base commit.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
Round 11 of the chat project delete review: CRF-149 is verified fixed in 7145b4a. A wildcard reviewer found two P4 issues in code that has not changed since round 4, both about sub-chats carrying their root's project.
coderd/x/chatd/project_instructions.go:17
P4 [CRF-153] "Subagent chats do not carry a project" is false after this PR. (Knov)
Migration 000630 backfills sub-chats, its trigger sets their project on insert, and SetFamilyProject now moves every member, so a sub-chat's own ProjectID is the source of truth. Rewrite the sentence to say sub-chats carry their root's project. Once CRF-152's trigger is in place, the root lookup at lines 29 to 41 only costs one GetChatByID per turn for sub-chats outside a project and can be removed.
🤖
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
|
/coder-agents-review |
There was a problem hiding this comment.
Round 13 of the chat project delete review: CRF-156 and CRF-157 are verified fixed in 3c6508d, and TestResolveProjectInstructions passes. No new findings in the PR's changes, and no findings are open.
Out of scope (needs a ticket or explicit acceptance by a human):
coderd/x/chatd/project_instructions.go:20: the doc's second paragraph repeats the failure cases from theusableChatProjectdoc (projects.go:51); the paragraph is unchanged from the base commit.
🤖 This review was automatically generated with Coder Agents.
Chats that belong to a chat project now get the project's skills, next to personal, organization and workspace skills. They show up in the model's skill list, load through `read_skill`, and appear in a "Project skills" group in the `/` menu. - `coderd/x/skills` adds the `project` source. `MergeSkills` now takes a list of sources in merge order (personal, organization, project, workspace). Bare names stay bare unless two sources share a name, in which case they get `project/<name>` style aliases. - chatd loads project skills only when the chat owner owns the project or the project is shared with them. Role grants don't count. This is the same `usableChatProject` check that project instructions and memory use, and one check per turn covers both instructions and skills. Disabled skills are skipped. A failed load logs a warning and the turn continues without them. Subagents use their root chat's project; that lookup is now a helper shared with project instructions. - The site loads project skills for the composer on the project page and in project chats, behind the `chat-projects` experiment. `/clear` and `/compact` defer to a project skill with the same name, as they already do for other sources. When the user can't use the project, the site treats it as no project skills, like chatd, so those commands keep working and the `/` menu shows no retry prompt for project skills. That covers a 403 or 404 from the project skills request and a project missing from the user's project list, which holds only owned and shared projects, so an administrator role that can read the project doesn't count. Other failures are retried and leave the list unknown. A cached project list is also unknown while it refetches or after a failed refetch, so a share revoked since it was cached keeps those commands pending instead of deferring to stale project skills. - Docs gain a "Project skills" section in the extending agents page. `coderd/x/chatd/ARCHITECTURE.md` gains a paragraph on project skills. Dogfood UAT on this branch passed: project skills appear in the project page `/` menu and in project chats, `read_skill` loads them, disabled and deleted skills report not found, chats outside the project don't see them, and a subagent gets them through its root chat. The site reads project skills from the chat's own `project_id`, so subagent chats show them in the composer once sub-chats carry their root's project (#30683). | Project page `/` menu | `read_skill` in a project chat | | --- | --- | | <img alt="Project skills group in the project page slash menu" src="https://raw.githubusercontent.com/coder/coder/assets/pr-30838-project-skills/pr/project-page-slash-menu.png" width="600" /> | <img alt="read_skill loading a project skill in a project chat" src="https://raw.githubusercontent.com/coder/coder/assets/pr-30838-project-skills/pr/project-chat-read-skill.png" width="600" /> | Stack (merge top to bottom): - #30838 👈 - #30854 - #30855 - #30856 - #30861 - #30880 - #30881 - #30882 - #30884 - #31122
Adds `docs/ai-coder/agents/projects.md`, a short page for Coder Agents
projects, linked under Coder Agents as early access.
The page covers:
- What a project provides.
- Ownership: organization-scoped, private to the creator, 100 per user,
audited.
- Creating, editing, and deleting projects.
- Adding chats to a project: project page, composer picker, **Move to
project**, drag onto a folder, and `PATCH /api/v2/chats/{chat}`.
- Instructions, with a link to the existing Project skills section for
skills.
- Memory: tools, behavior, limits, and the API.
It also links `extending-agents.md#project-skills` to the new page.
The page documents projects as early access with no experiment flag.
Merge it only once `chat-projects` no longer gates the feature. The
memory and skill APIs it mentions still live under `/api/experimental`.
Project sharing is left out until its UI lands (#31246, #31245).
Open PRs that will make parts of this page stale:
- #30683 changes project deletion.
- #30754, #30756, and #30898 add project templates.
> Generated by Coder Agents on behalf of @f0ssel.
Deleting a chat project now removes its chats, including chats started by people it is shared with. Before this, deleting a project detached its chats, and #30479 and #30439 keep that behavior.
DELETE /chats/projects/{project}locks the project, setschat_projects.deleted(a one-way tombstone), deletes the project's memories, instructions and skills, and returns 204; a repeat returns 404. It takes no chat locks, so it can't fail or ask the caller to retry. Only the project delete is audited.ExtractChatParam, and file download skip a deleted project and its chats. Root chat creation, moves into or out of a project, unarchives, and memory and instructions writes hold the projectFOR SHARE(skill insertsFOR NO KEY UPDATE, the mode the skill limit trigger takes), so a racing one either finishes before the delete (and is cleaned up with the rest) or gets 404. Audit entries show the chats as deleted.Server.ScheduleDeletedChatProjectCleanuprunschatstate.ArchiveDeletedChatProject. In one transaction it locks the project's unarchived root chats, archives every unarchived chat in the project with no worker or runner, clears their queues, and reads every chat in the project. It then publisheschat:update(runners stop mid-turn), schedules debug-data cleanup, and publishes a newproject_deletedwatch event for every chat in the project, archived ones included (sidebars evict the chat). Running chats keep generating until the cleanup runs.GetDeletedChatProjectIDsWithUnarchivedChats). The sweep covers cleanups that failed, for example on a deadlock with a chat purge or an agent context push, or never ran because the replica stopped. A second pass leaves chats that are already archived alone, so their retention clock doesn't restart.project_id. Migration 000630 backfills it and adds an insert trigger that sets it, and moving a root chat moves its sub-chats too, so project queries match on that column alone. A sub-chat stays in its project even if retention deletes its root first.Decision log
ChatMachinetransition, to keep the root locks short; its SET list mirrorsUpdateChatExecutionState.chats_expandedcolumn, to avoid a project join on every chat read.SetFamilyProjectupdates every family member'sproject_idinstead of only the root's, so the cleanup'sproject_idmatch still covers sub-chats.deleteChatProjectresets cached chat entities inonSuccess, notmutationFn, so a mutation function only performs the request (frontend review). The sidebar reads the open chat's entity inonMutate, since aproject_deletedevent can reset it before the response, to decide whether to leave the page.