Repository navigation
feat(coderd/x/chatd): add the search_chats chat tool - #52
Conversation
Codex Review Summary: ✅ CompletedThis 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dddaee44ea
ℹ️ 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".
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
…-7-search-chats # Conflicts: # coderd/x/chatd/fork_chat_todos_internal_test.go # coderd/x/chatd/fork_tools.go
Merged at 4e4b2fe after these checks:
|
Part of #10. Independent of #48 (
read_chat_transcript); the two touch the same line infork_tools.go, so whichever merges second needs a one-line merge.Adds
search_chats, a chat tool that finds chats with the chat list search syntax (docs/coder-agents/chat-search-syntax.md), so an agent can find a past chat to read. Behindfork-chat-todos, like the todo tools;appendForkToolsadds it.query(theqsyntax ofGET /api/v2/chats, parsed bysearchquery.Chats, so the same filters, defaults and errors apply),after_idcursor andlimit(1 to 50, default 20). A page returnschat_id,title,status,created_at,updated_atandshared(owned by another user) per chat, plusnext_after_idandhas_more.httpmw.UserRBACSubjectanddbauthz.As, likeasOwnerinchattool/listtemplates.go), never as chatd, and with the owner as the viewer, so it finds what the owner's chat list finds: their own chats by default, and chats shared with them (user or group ACL) withsource:shared_with_me.searchcannot be combined withtitle,pr_titleorpr.ARCHITECTURE.md: one TODO line for the new tool.Validation:
TestSearchChatspasses against Postgres 17 with the store wrapped indbauthz, running the tool fromappendForkToolsthe way a turn does: the owner's top-level chats (a child and another user's chat are not found) with paging, a chat shared with the owner found only after it is shared and markedshared, and argument errors (bare words,searchwithtitle, limit, cursor). A negative control that drops thesharedfield fails the sharing subtest../coderd/x/chatd/...passes;go vetis clean.UAT on a dev instance with a local model (fc17b34, the head of #53 before review fixes, which contains this PR's code;
fork-chat-todoson), from chats owned by a plain member:title:<word>returned the member's two matching chats with titles, status and timestamps, and not the admin's chat with the same word.source:created_by_me,shared_with_me, the admin's chat was absent until the admin shared it with the member; then it came back withshared: true.invalid query: q: unsupported search term: "deploy".