Repository navigation
fix(trace-path): use portable case-insensitive symbol lookup - #127
Merged
Merged
Conversation
When trace_path found no exact symbol, its fallback queries used `COLLATE NOCASE`, which only SQLite has. On PostgreSQL the tool failed with "collation nocase for encoding UTF8 does not exist" for any symbol that was not an exact match (for example a wrong letter case or an unknown name). The fallback now compares LOWER(column) = LOWER(?), which works on both databases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es-nocase # Conflicts: # REQUIREMENTS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On PostgreSQL (the portable bundle),
trace_pathfails for every symbol that is not an exact match:The two fallback queries in
graph_traversal.py(symbol lookup and relationship lookup) useCOLLATE NOCASE, which only SQLite has. So a wrong letter case, or a name that is not indexed, gives a database error instead of a result or a "not found" answer.Fix
Both fallback queries now use
LOWER(column) = LOWER(?)(andLOWER(full_symbol) LIKE LOWER(?)), which works on SQLite and PostgreSQL. I ran the new symbol query on a PostgreSQL 16 index:assistantscontroller.runinstancefindsAssistantsController.RunInstance.Tests
tests/test_trace_path_case_insensitive.py:graph_traversal.pycontains noNOCASE(CI has no PostgreSQL, so this guard keeps the SQL portable).🤖 Generated with Claude Code