Skip to content

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Sep 29, 2025

Doesn't seem like this always gets called anyhow so doesn't seem like there's much harm.

@gagik gagik requested a review from a team as a code owner September 29, 2025 11:58
@gagik gagik requested review from Copilot and lerouxb and removed request for Copilot September 29, 2025 11:58
@gagik gagik added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Sep 29, 2025
@Copilot Copilot AI review requested due to automatic review settings September 29, 2025 12:27
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the Compass Assistant to encourage more frequent usage of the 'search_content' tool and fixes duplicate source titles in the UI. The changes move from conditional to unconditional search_content tool usage and implement deduplication for source links.

  • Updated prompts to always call the 'search_content' tool instead of only for technical questions
  • Added deduplication logic to prevent showing duplicate source titles in the UI
  • Added comprehensive test coverage for the duplicate source handling

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/compass-assistant/src/prompts.ts Simplified search_content tool usage instruction to always call it
packages/compass-assistant/src/components/assistant-chat.tsx Added deduplication logic for source titles using Set tracking
packages/compass-assistant/src/components/assistant-chat.spec.tsx Added test case to verify duplicate source title handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +384 to +398
const seenTitles = new Set<string>();
const sources = [];
for (const part of parts) {
if (part.type === 'source-url') {
const title = part.title || 'Documentation Link';
if (!seenTitles.has(title)) {
seenTitles.add(title);
sources.push({
children: title,
href: part.url,
variant: 'Docs',
});
}
}
}
Copy link
Preview

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

The deduplication logic only considers titles but ignores URLs. This means different URLs with the same title will be filtered out, potentially hiding useful distinct resources. Consider using a combination of title and URL for deduplication, or use the first URL encountered for each title.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that's the point :)

@gagik gagik merged commit f4b6c4c into main Sep 30, 2025
60 checks passed
@gagik gagik deleted the gagik/prompt branch September 30, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants