You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: query: lead with the file that matches a natural-language question best, not the single best-scoring node #4480
On a natural-language question, graphify query starts from the single best-scoring node, and the renderer prints the start nodes first. On a question of three or more words, that node is often a test, whose name repeats the words of the bug report, or a same-named helper in another file. The file the question is about usually matches through several of its nodes at once, each scoring a little lower, so it ends up behind them. An agent reading the answer starts in the wrong file.
Measured on SWE-bench Lite: 285 issues across 12 repos, graphs from graphify update, default BFS depth 2, 2,000-token budget, with the fix's changed files as the key.
Asked by the issue title, the fixed file is printed first for 78 of 285.
Of the 207 misses, the first file is a test 58 times, a file in the same folder 41 times, and a file elsewhere 108 times.
The fixed file is among the 50 best-scored nodes in 113 of those 207, so the ranking already holds it; it just doesn't lead.
Proposed solution
For a question of three or more terms:
sum the scores of the 50 best-scored candidates per file;
put the best node of the best file first among the start nodes, and keep the other seeds in their order behind it;
let a test file lead only when the question names tests, or when nothing else matches.
Short queries (identifier lookups) keep their exact match first. Explicit --seed values are untouched.
Fixed file printed first / in the first 3 / in the first 5 files, out of 285:
by title
by title + 400 characters
v8 today
78 / 115 / 131
67 / 99 / 122
proposed
88 / 121 / 136
80 / 117 / 140
The constants were chosen on django and sympy. On the 10 other repos alone, right file first goes 24 → 27 by title and 20 → 29 by title + 400.
Alternatives considered
The per-file sum alone (test files may lead): 73 / 120 / 135 and 45 / 104 / 128. Test files gather many matching nodes, so the top-1 gets worse.
The test rule alone (the best non-test node leads): 83 / 115 / 132 and 76 / 100 / 122. It helps the first file but not the top five.
Ranking the whole answer by file: worse, at 27 / 75 / 97 by title.
Activity
github-actions commentedon Oct 15, 2026
Thanks for opening this issue, @devkancheti4-design. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.