Skip to content

Feature: graph tool #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Feature: graph tool #169

wants to merge 10 commits into from

Conversation

Naseem77
Copy link

No description provided.

Naseem77 added 9 commits May 5, 2025 11:06
- Graph exists + function found/not found
- Creation progress tracking and timeout handling
- Background graph creation with API integration
- Input validation and error handling
- Multi-repo independence and stale lock cleanup
@Copilot Copilot AI review requested due to automatic review settings June 19, 2025 10:03
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 introduces a new tool fetchUsageCodeExamples that uses a code graph to find and return usage examples for a given function in the repository.

  • Imports and utility functions for graph operations (graphTools.js) and GitHub fetching
  • Implements fetchUsageCodeExamples in DefaultRepoHandler.ts, handling graph creation, progress reporting, timeouts, and example formatting
  • Updates test descriptions, adds the falkordb dependency, and extends the .env.example with code graph configuration

Reviewed Changes

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

File Description
src/api/tools/repoHandlers/DefaultRepoHandler.ts Added fetchUsageCodeExamples tool, graph service imports, and logic
src/api/tools/index.test.ts Registered fetchUsageCodeExamples in tests (descriptions only)
package.json Added falkordb dependency
.env.example Added environment variables for code graph server and config
Comments suppressed due to low confidence (1)

src/api/tools/index.test.ts:70

  • The new fetchUsageCodeExamples tool is registered but no unit tests are validating its behavior. Consider adding tests for success, empty results, and error/timeouts scenarios.
      {

functionName: z
.string()
.describe("Name of the function to find who calls it"),
// limit: z.number().optional().default(10).describe("Max number of calling functions to return")
Copy link
Preview

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

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

The limit parameter is commented out in paramsSchema, so the default value in the callback will never be applied. Uncomment or add a limit: z.number().optional().default(10) entry to ensure it's validated.

Suggested change
// limit: z.number().optional().default(10).describe("Max number of calling functions to return")
limit: z.number().optional().default(10).describe("Max number of calling functions to return"),

Copilot uses AI. Check for mistakes.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants