Skip to content

feat(search): list your own chat history on Search MCP and in the Assistant - #10537

Merged
waleedlatif1 merged 10 commits into
stagingfrom
feat/list-my-chat-history
Dec 1, 2026
Merged

waleedlatif1 merged 10 commits into
stagingfrom
feat/list-my-chat-history

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • New list_my_chat_history: the caller's own questions to Sim between startDate (inclusive) and endDate (exclusive, default now, at most 92 days), oldest first, paged with topK (default 50, max 100) and cursor / nextCursor
  • Each question carries its UTC time, chatId, a link to the conversation, and its surface (assistant, agent, slack). includeAnswers adds the first 600 characters of Sim's reply to that question (never the reply to a later question), without cards or citation tags
  • Covers Assistant and agent chats in the organization (including those asked through the Slack app and Search MCP chat) 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 runs
  • Caller only: the person comes from the principal (requirePrincipalSubjectUserId), never from input. A principal with no person (workspace API key) is refused, and Search MCP does not list the tool to one
  • One use case (lib/knowledge/application/chat-history.ts, operation knowledge.chat_history.list, search:read, copilot.use) behind two surfaces:
    • Search MCP tool list_my_chat_history
    • Organization Assistant server tool of the same name (delegated principal bound to the member's private chat, as search_people), added to ASSISTANT_TOOLS
  • Contract listMyChatHistoryInputSchema in assistantToolContracts; Sim's generated tool catalog regenerated from the Mothership staging catalog

Mothership follow-up (not in this PR)

  • Add list_my_chat_history to buildAssistantTools beside search_people (organization runs), and regenerate sim-assistant-tools.generated.ts with bun run generate:cli-inventory, after this PR is on staging

Workflow surface

  • The Organization Search block operation list_my_chat_history (organization_list_my_chat_history) follows in a separate PR, admitting the executor delegated service on this operation

Type of Change

  • New feature

Testing

  • lib/knowledge/application/chat-history.integration.ts against 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 red
  • lib/knowledge/mcp/server.test.ts: the tool is listed for a person and not for a workspace API key (red with the gate removed)
  • Unit suites: lib/knowledge/mcp, lib/mothership/tools/server, mothership-assistant-tools.test.ts
  • check:file-names, check:boundaries, check:source-conventions, check:comment-hygiene, check:tool-effects, lint

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 1, 2026 7:30am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no outstanding blocking issue was found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no outstanding blocking issue was found.

Summary

Adds list_my_chat_history to Search MCP and prepares the Organization Assistant server tool.

  • Members can page through their own Sim questions from a date window.
  • Search MCP offers a person’s own chat history as a read-only tool.
  • The organization Assistant can look up its member’s own chat history.

Reviews (9) · Last reviewed commit: "fix(search): chat history lists only con..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 15 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the feat/list-my-chat-history branch from 691a4ff to 42548c7 Compare December 1, 2026 07:16
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 15 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@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 cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 15 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

This branch was previously deployed

1 inactive deployment
Preview — 04a51dc0 Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant