Repository navigation
fix(graph): report k-hop relation and depth limitations - #3427
Merged
Merged
Conversation
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
agentdb_graph-queryacceptsrelationand advertises five-hop k-hop queries. The native backend ignoresrelation, while the SQL fallback executes at most three hops but reports the requested depth. A caller can treat an over-broad result or an incomplete cycle check as authoritative.Change
Native graph-node now returns a machine-readable
unsupported: "relation"error for filtered k-hop queries. ItskHopNeighborsAPI cannot filter, and the native and SQL stores are not an atomic mirror (agentdb_causal-edgewrites SQL asynchronously), so silently switching to SQL could create a false negative. When native is unavailable, the SQL path still applies the relation predicate. Every successful k-hop response now reportsappliedDepth; SQL responses settruncated: truewhen the existing three-hop bound clips the request. The tool description explains both limits.Validation
origin/mainfails 6/6 cases.git diff --check: pass.The tests mock backend availability and inspect the SQL sent to the query layer; they do not claim a real native/SQLite integration run. The existing SQL depth bound is preserved to avoid expanding recursive-query cost in this fix.
Fixes #3202