Repository navigation
feat(search): list your own chat history on Search MCP and in the Assistant - #10537
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no outstanding blocking issue was found. SummaryAdds
Reviews (9) · Last reviewed commit: "fix(search): chat history lists only con..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
…answers, precise cursor
…on Search availability
691a4ff to
42548c7
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
list_my_chat_history: the caller's own questions to Sim betweenstartDate(inclusive) andendDate(exclusive, default now, at most 92 days), oldest first, paged withtopK(default 50, max 100) andcursor/nextCursorchatId, a link to the conversation, and its surface (assistant,agent,slack).includeAnswersadds the first 600 characters of Sim's reply to that question (never the reply to a later question), without cards or citation tagschat) and home chats in the organization's workspaces the caller can still open. Leaves out deleted conversations and messages, automated task and job turns, workflow copilot chats and benchmark runsrequirePrincipalSubjectUserId), never from input. A principal with no person (workspace API key) is refused, and Search MCP does not list the tool to onelib/knowledge/application/chat-history.ts, operationknowledge.chat_history.list,search:read,copilot.use) behind two surfaces:list_my_chat_historysearch_people), added toASSISTANT_TOOLSlistMyChatHistoryInputSchemainassistantToolContracts; Sim's generated tool catalog regenerated from the Mothership staging catalogMothership follow-up (not in this PR)
list_my_chat_historytobuildAssistantToolsbesidesearch_people(organization runs), and regeneratesim-assistant-tools.generated.tswithbun run generate:cli-inventory, after this PR is on stagingWorkflow surface
list_my_chat_history(organization_list_my_chat_history) follows in a separate PR, admitting theexecutordelegated service on this operationType of Change
Testing
lib/knowledge/application/chat-history.integration.tsagainst real Postgres (9 tests): only the caller's own questions, oldest first, with surface and link; deleted chats/messages, job turns, workflow copilot and benchmark chats excluded; workspace chats only in the organization's workspaces the caller can open; inclusive start, exclusive end, 92-day cap; bounds in their own offset and the default end; paging through identical timestamps without repeats or gaps; answer excerpts, and none for an unanswered question; outsiders and workspace keys refused. Reverting the owner,origin, workspace-organization, keyset-id and unanswered-question guards each turns its test redlib/knowledge/mcp/server.test.ts: the tool is listed for a person and not for a workspace API key (red with the gate removed)lib/knowledge/mcp,lib/mothership/tools/server,mothership-assistant-tools.test.tscheck:file-names,check:boundaries,check:source-conventions,check:comment-hygiene,check:tool-effects, lintChecklist
test-auditauthoring gate)