René's URL Explorer Experiment


Title: Bug: `get_module_summary` returns files=0/functions=0/lines=0 on Windows (path_matches only checks `/` separator) · Issue #5 · codegraph-ai/CodeGraph · GitHub

Open Graph Title: Bug: `get_module_summary` returns files=0/functions=0/lines=0 on Windows (path_matches only checks `/` separator) · Issue #5 · codegraph-ai/CodeGraph

X Title: Bug: `get_module_summary` returns files=0/functions=0/lines=0 on Windows (path_matches only checks `/` separator) · Issue #5 · codegraph-ai/CodeGraph

Description: Bug Report Summary get_module_summary returns files=0, functions=0, classes=0, lines=0 on Windows for any directory. external_deps incorrectly returns all workspace-wide external dependencies instead of module-scoped ones. Environment OS...

Open Graph Description: Bug Report Summary get_module_summary returns files=0, functions=0, classes=0, lines=0 on Windows for any directory. external_deps incorrectly returns all workspace-wide external dependencies inste...

X Description: Bug Report Summary get_module_summary returns files=0, functions=0, classes=0, lines=0 on Windows for any directory. external_deps incorrectly returns all workspace-wide external dependencies inste...

Opengraph URL: https://github.com/codegraph-ai/CodeGraph/issues/5

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: `get_module_summary` returns files=0/functions=0/lines=0 on Windows (path_matches only checks `/` separator)","articleBody":"## Bug Report\n\n### Summary\n\n`get_module_summary` returns `files=0`, `functions=0`, `classes=0`, `lines=0` on Windows for any directory. `external_deps` incorrectly returns all workspace-wide external dependencies instead of module-scoped ones.\n\n### Environment\n- **OS**: Windows 10/11\n- **Package**: `@astudioplus/codegraph-mcp` 0.18.2–0.18.4\n- **Graph size**: 65,556 nodes, 2,615 CodeFiles\n\n### Root Cause\n\nFile: `crates/codegraph-server/src/domain/module_summary.rs`, function `path_matches()` (line ~217):\n\n```rust\nfn path_matches(path: \u0026str, prefix: \u0026str) -\u003e bool {\n    if prefix.is_empty() { return true; }\n    if path == prefix { return true; }\n    path.starts_with(prefix) \u0026\u0026 path[prefix.len()..].starts_with('/')  // \u003c-- BUG\n}\n```\n\nOn Windows, the graph stores paths with backslash separators (via `file_path.display().to_string()`):\n- `path` = `\"C:\\Users\\...\\agent\\prompt_builder.py\"`\n- `prefix` = `\"C:\\Users\\...\\agent\"`\n\n`path.starts_with(prefix)` is `true`, but `path[prefix.len()..]` starts with `\\` not `/`, so the function returns `false`. Every CodeFile/Function/Class node is skipped, resulting in all-zero counts.\n\nI verified this with a local Rust reproduction:\n\n```\npath_matches_original(\"C:\\Users\\...\\agent\\prompt_builder.py\", \"C:\\Users\\...\\agent\") =\u003e false\npath_matches_fixed(\"C:\\Users\\...\\agent\\prompt_builder.py\", \"C:\\Users\\...\\agent\")    =\u003e true\n```\n\n### Proposed Fix\n\nNormalise both sides to forward slashes before comparing:\n\n```rust\n#[inline]\nfn path_matches(path: \u0026str, prefix: \u0026str) -\u003e bool {\n    if prefix.is_empty() {\n        return true;\n    }\n    let norm_path: String = path.replace('\\\\', \"/\");\n    let norm_prefix: String = prefix.replace('\\\\', \"/\");\n    if norm_path == norm_prefix {\n        return true;\n    }\n    norm_path.starts_with(norm_prefix.as_str())\n        \u0026\u0026 norm_path[norm_prefix.len()..].starts_with('/')\n}\n```\n\nWith corresponding Windows test cases:\n\n```rust\n#[test]\nfn test_path_matches_windows_backslash() {\n    assert!(path_matches(\n        \"C:\\\\Users\\\\me\\\\project\\\\src\\\\main.rs\",\n        \"C:/Users/me/project/src\"\n    ));\n}\n\n#[test]\nfn test_path_matches_windows_backslash_prefix() {\n    assert!(path_matches(\n        \"C:\\\\Users\\\\me\\\\project\\\\src\\\\main.rs\",\n        \"C:\\\\Users\\\\me\\\\project\\\\src\"\n    ));\n}\n\n#[test]\nfn test_path_matches_windows_no_partial_dir() {\n    assert!(!path_matches(\n        \"C:\\\\Users\\\\me\\\\project\\\\src_foo\\\\main.rs\",\n        \"C:/Users/me/project/src\"\n    ));\n}\n```\n\n### Additional Issue: `trim_end_matches('/')` doesn't trim `\\`\n\nLine 64: `let prefix = directory.trim_end_matches('/');`\n\nThis also needs to trim backslash on Windows. Suggested fix:\n\n```rust\nlet prefix = directory.trim_end_matches(|c| c == '/' || c == '\\\\');\n```\n\n### Steps to Reproduce\n\n1. Install codegraph-mcp on Windows\n2. Index a workspace\n3. Call `get_module_summary` with any valid directory path:\n   ```\n   get_module_summary(path=\"C:\\\\Users\\\\me\\\\project\\\\src\")\n   ```\n4. Observe: `files=0`, `total_functions=0`, `total_classes=0`, `total_lines=0`\n\n### Expected Result\n\nNon-zero counts matching the actual files/functions/classes in that directory.\n\n### Workaround\n\nNone currently available — the bug is in the compiled Rust binary.\n","author":{"url":"https://github.com/MuBeiGe","@type":"Person","name":"MuBeiGe"},"datePublished":"2026-06-05T15:58:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/5/CodeGraph/issues/5"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9331629d-2bb5-7032-531c-4a062e583bac
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id98B4:104714:8FB81C:CF45BD:6A4CE893
html-safe-nonceaec0c5ad95d8149c6907d8c6d7461787e4aca5e2c1f1576d62460b2396906836
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEI0OjEwNDcxNDo4RkI4MUM6Q0Y0NUJEOjZBNENFODkzIiwidmlzaXRvcl9pZCI6IjY4MDc3ODUxMjAyOTM3NzU1MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacac3d5f2a7b850eb743398e6bc503f65f7486a9604c4cad14838c37b7ff991789
hovercard-subject-tagissue:4598264002
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/codegraph-ai/CodeGraph/5/issue_layout
twitter:imagehttps://opengraph.githubassets.com/321c3418d963ab407da058b4079e4e043a1ae183c0f43013f5cabf9dc818f8d5/codegraph-ai/CodeGraph/issues/5
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/321c3418d963ab407da058b4079e4e043a1ae183c0f43013f5cabf9dc818f8d5/codegraph-ai/CodeGraph/issues/5
og:image:altBug Report Summary get_module_summary returns files=0, functions=0, classes=0, lines=0 on Windows for any directory. external_deps incorrectly returns all workspace-wide external dependencies inste...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMuBeiGe
hostnamegithub.com
expected-hostnamegithub.com
None299b43bca6e02ad35197ffeba30d2466846d5fb02ab96fbced5b5e6cec589fb8
turbo-cache-controlno-preview
go-importgithub.com/codegraph-ai/CodeGraph git https://github.com/codegraph-ai/CodeGraph.git
octolytics-dimension-user_id249074060
octolytics-dimension-user_logincodegraph-ai
octolytics-dimension-repository_id1201596241
octolytics-dimension-repository_nwocodegraph-ai/CodeGraph
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1201596241
octolytics-dimension-repository_network_root_nwocodegraph-ai/CodeGraph
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec5a57f04eeb310f57c73fd6d751d957e2ca27ed2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/codegraph-ai/CodeGraph/issues/5#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcodegraph-ai%2FCodeGraph%2Fissues%2F5
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcodegraph-ai%2FCodeGraph%2Fissues%2F5
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=codegraph-ai%2FCodeGraph
Reloadhttps://github.com/codegraph-ai/CodeGraph/issues/5
Reloadhttps://github.com/codegraph-ai/CodeGraph/issues/5
Reloadhttps://github.com/codegraph-ai/CodeGraph/issues/5
Please reload this pagehttps://github.com/codegraph-ai/CodeGraph/issues/5
codegraph-ai https://github.com/codegraph-ai
CodeGraphhttps://github.com/codegraph-ai/CodeGraph
Please reload this pagehttps://github.com/codegraph-ai/CodeGraph/issues/5
Notifications https://github.com/login?return_to=%2Fcodegraph-ai%2FCodeGraph
Fork 5 https://github.com/login?return_to=%2Fcodegraph-ai%2FCodeGraph
Star 35 https://github.com/login?return_to=%2Fcodegraph-ai%2FCodeGraph
Code https://github.com/codegraph-ai/CodeGraph
Issues 0 https://github.com/codegraph-ai/CodeGraph/issues
Pull requests 1 https://github.com/codegraph-ai/CodeGraph/pulls
Actions https://github.com/codegraph-ai/CodeGraph/actions
Projects https://github.com/codegraph-ai/CodeGraph/projects
Security and quality 0 https://github.com/codegraph-ai/CodeGraph/security
Insights https://github.com/codegraph-ai/CodeGraph/pulse
Code https://github.com/codegraph-ai/CodeGraph
Issues https://github.com/codegraph-ai/CodeGraph/issues
Pull requests https://github.com/codegraph-ai/CodeGraph/pulls
Actions https://github.com/codegraph-ai/CodeGraph/actions
Projects https://github.com/codegraph-ai/CodeGraph/projects
Security and quality https://github.com/codegraph-ai/CodeGraph/security
Insights https://github.com/codegraph-ai/CodeGraph/pulse
Bughttps://github.com/codegraph-ai/CodeGraph/issues?q=type:"Bug"
Bug: get_module_summary returns files=0/functions=0/lines=0 on Windows (path_matches only checks / separator)https://github.com/codegraph-ai/CodeGraph/issues/5#top
https://github.com/MuBeiGe
MuBeiGehttps://github.com/MuBeiGe
on Jun 5, 2026https://github.com/codegraph-ai/CodeGraph/issues/5#issue-4598264002
Bughttps://github.com/codegraph-ai/CodeGraph/issues?q=type:"Bug"
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.