Repository navigation
improvement(search): smaller chat history pages with a first-page total - #10567
Merged
Merged
Conversation
…and an ids-only workspace check
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge; the previous empty-history issue is fixed. SummaryThis PR makes chat-history pages smaller and adds a first-page question count.
No new actionable issues were found. Reviews (2) · Last reviewed commit: "fix(search): an empty first page counts ..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
left()in SQL, one character past the cap so a cut question ends in..., code-point safe) and each answer excerpt at 300 (was 2,000 and 600). A default page was around 67k characters and 115-178k attopK100 or with answers, over what MCP clients keep inline; a benchmark prototype with these caps answered as well or better with about 48k fewer input tokens per tasktotalon the first page. The number of the caller's questions in the window, counted with the page's own filter, on the first page only, so a model paging through no longer has to add pages up. It reads the samecopilot_messages_chat_user_created_at_idxrange as the page: about 10 ms warm for about 2,000 questions in a 30-day window on a seeded local DBlistAccessibleWorkspaceRowsForUser(slow for a person with many workspaces). The organization's workspaces the caller can open are a subquery of ids in the chat read: every active workspace for an organization admin or owner, otherwise those they hold a permission on, the same rule as beforetotalis described on the Search MCP tool, the workflow tool and the Organization Search block outputsType of Change
Testing
lib/knowledge/application/chat-history.integration.ts(20): adds a 2,000-character question returned as 400 characters plus...(red without the extra read character),totalon the first page only (red without it), and an organization admin seeing a workspace chat without a permission row (red without the admin branch); the answer excerpt test now bounds 300lib/mothership/tools/server/knowledge/chat-history.integration.ts,lib/internal/organization-search/execute-tool.integration.tsstill greenlib/knowledge/mcp,lib/mothership/tools/server,blocks,tools/organizationbun run generate, lint,check:file-names,check:boundaries,check:source-conventions,check:comment-hygiene,check:tool-effects,check:integration-catalog,check:unused-exportsChecklist
test-auditauthoring gate)