Skip to content

Conversation

himanshusinghs
Copy link
Collaborator

Proposed changes

Adds a small helper on session to check if search indexes are supported by the connected cluster and adds this information on the debug resource as well.

Checklist

@himanshusinghs himanshusinghs requested a review from a team as a code owner October 9, 2025 09:22
@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 09:22
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 adds functionality to detect if a connected MongoDB cluster supports search indexes and exposes this information through the debug resource. The changes enable better visibility into cluster capabilities for users.

Key changes:

  • Added a new isSearchIndexSupported() method to the Session class that tests search index support
  • Updated the debug resource to display search index support status when connected
  • Made the debug resource's toOutput() method asynchronous to accommodate the new capability check

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/common/session.ts Implements the isSearchIndexSupported() method that tests search index capability
src/resources/common/debug.ts Updates debug output to show search index support status and makes toOutput() async
src/resources/resource.ts Updates base resource class to support async toOutput() method
tests/unit/common/session.test.ts Adds unit tests for the new search index support detection method
tests/unit/resources/common/debug.test.ts Updates existing tests to handle async toOutput() and adds test for search index support display
case "connected":
result += "The user is connected to the MongoDB cluster.";
case "connected": {
const searchIndexesSupported = await this.session.isSearchIndexSupported();
Copy link
Collaborator

@gagik gagik Oct 10, 2025

Choose a reason for hiding this comment

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

I don't mind these additions but this seems like a bit of random information to include. What will be the deciding factor in what output we'll show here? I imagine there's a ton of info which could be relevant in that sense.

Copy link
Collaborator Author

@himanshusinghs himanshusinghs Oct 13, 2025

Choose a reason for hiding this comment

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

So far the idea is to have anything connection related that might help Agent debug a problem with tool calls / connectivity problems.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In this case - we're expecting Agent to use debug resource at some point when its attempting to do search related work like creating search index. Although the tool call would respond with the appropriate error but there is a good chance of agent pulling debug resource information so we should have search related metadata here as well.

@himanshusinghs himanshusinghs force-pushed the chore/search-index-detection branch from a24977a to 039471d Compare October 13, 2025 16:25
@himanshusinghs himanshusinghs force-pushed the chore/search-index-detection branch from 312ec75 to 8fac3a2 Compare October 13, 2025 19:01
@himanshusinghs himanshusinghs merged commit faad36d into main Oct 13, 2025
18 checks passed
@himanshusinghs himanshusinghs deleted the chore/search-index-detection branch October 13, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants