Repository navigation
fix(graph_falkordb): fail loudly on a missing graph instead of silently falling back - #2292
Conversation
…ly falling back A read-only node whose "Default Graph" doesn't exist on the server was silently resolving to whatever preconfig.default declares (agent), rather than the graph the user actually intended. FalkorDB accepts a query against a missing graph and only fails on the first result, with "ERR Invalid graph operation on empty key" -- an error that gives no hint the graph itself was the problem (rocketride-org#2155). - _open_driver now raises a clear error naming the missing graph and the ones that do exist, at pipeline start rather than on first query. - _probe_connection warns the same way at save time. - Both skip the check when allow_writes or allow_execute is on, since FalkorDB creates a graph lazily on its first write -- a write-capable node may legitimately target one that doesn't exist yet. - The canvas tile was empty, so the active graph -- or that it had silently fallen back to one -- was invisible without opening the inspector. It now shows "Graph: <name>". The original report described the fields as unexposed/unpersisted; they already were (confirmed by a prior investigation on the issue). The real defect was the silent, unvalidated fallback, which is what this fixes.
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe FalkorDB node now resolves blank graph names to ChangesFalkorDB graph configuration
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant Pipeline
participant IGlobal
participant FalkorDB
Pipeline->>IGlobal: Start or probe connection
IGlobal->>IGlobal: Resolve graph name
IGlobal->>FalkorDB: Request list_graphs()
FalkorDB-->>IGlobal: Return available graphs
IGlobal-->>Pipeline: Raise error or emit warning when graph is absent
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk remains in the reviewed graph validation and display changes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 2 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 Biome (2.5.11)nodes/src/nodes/graph_falkordb/services.jsonFile contains syntax errors that prevent linting: Line 2: Expected a property but instead found '//'.; Line 6: End of file expected; Line 6: End of file expected; Line 6: End of file expected; Line 6: End of file expected; Line 11: End of file expected; Line 11: End of file expected; Line 11: End of file expected; Line 11: End of file expected; Line 18: End of file expected; Line 18: End of file expected; Line 18: End of file expected; Line 18: End of file expected; Line 24: End of file expected; Line 24: End of file expected; Line 24: End of file expected; Line 24: End of file expected; Line 30: End of file expected; Line 30: End of file expected; Line 30: End of file expected; Line 30: End of file expected; Line 36: End of file expected; Line 36: End of file expected; Line 36: End of file expected; Line 36: End of file expected; Line 42: End of file expected; Line 42: End of file expected; Line 42: End of file expected; Line 42: End of file expected; Line 47: End of file expected; Li ... [truncated 1224 characters] ... le expected; Line 94: End of file expected; Line 94: End of file expected; Line 106: End of file expected; Line 113: End of file expected; Line 113: End of file expected; Line 222: Expected a property but instead found '//'.; Line 113: End of file expected; Line 222: End of file expected; Line 227: End of file expected; Line 227: End of file expected; Line 227: End of file expected; Line 230: End of file expected; Line 231: End of file expected; Line 231: End of file expected; Line 231: End of file expected; Line 234: End of file expected; Line 235: End of file expected; Line 235: End of file expected; Line 235: End of file expected; Line 252: End of file expected; Line 262: End of file expected; Line 262: End of file expected; Line 262: End of file expected; Line 269: End of file expected Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
dsapandora
left a comment
There was a problem hiding this comment.
Approved. The write-capable exclusion is the right call and the reasoning for leaving the agent default alone holds — this only makes an already-broken config fail early and clearly. Two notes inline, neither blocking.
…ly falling back (rocketride-org#2292) A read-only node whose "Default Graph" doesn't exist on the server was silently resolving to whatever preconfig.default declares (agent), rather than the graph the user actually intended. FalkorDB accepts a query against a missing graph and only fails on the first result, with "ERR Invalid graph operation on empty key" -- an error that gives no hint the graph itself was the problem (rocketride-org#2155). - _open_driver now raises a clear error naming the missing graph and the ones that do exist, at pipeline start rather than on first query. - _probe_connection warns the same way at save time. - Both skip the check when allow_writes or allow_execute is on, since FalkorDB creates a graph lazily on its first write -- a write-capable node may legitimately target one that doesn't exist yet. - The canvas tile was empty, so the active graph -- or that it had silently fallen back to one -- was invisible without opening the inspector. It now shows "Graph: <name>". The original report described the fields as unexposed/unpersisted; they already were (confirmed by a prior investigation on the issue). The real defect was the silent, unvalidated fallback, which is what this fixes. Co-authored-by: madhumithachandrasekaran31 <madhumitha2110549@ssn.edu.in>
Summary
Fixes #2155.
@joshuadarron's investigation on the issue already established that the Manual/default profile fields (including "Default Graph") are correctly exposed in the node inspector and persisted into the
.pipewhen the node is actually opened and configured — there was no missing UI control. The real defect is what they identified: a node that was never opened in the inspector persists as{"name": "FalkorDB"}with no profile, which resolves throughConfig.getNodeConfig's no-profile branch topreconfig.default's"graph": "agent"— a plausible-looking but often-wrong silent default, with nothing telling the user which graph is actually in use or that it's a fallback.FalkorDB compounds this: unlike Neo4j (
graph_neo4j), which validates its target database for free by opening a session against it,select_graph()on a nonexistent FalkorDB graph always succeeds — the failure only surfaces on the first real query, as"ERR Invalid graph operation on empty key", an error that gives no hint the graph itself was the problem.This implements the two concrete fixes from that investigation (the issue's own suggestions #3 and #4):
_open_drivernow raises a clear error naming the missing graph and the ones that do exist, at pipeline start instead of on the first query. This reuses thelist_graphs()round-trip the driver already made to fail fast on a bad host/credentials — no extra network call._probe_connectionwarns the same way at save time, so a misconfigured graph is visible before the pipeline ever runs."tile": []); it now showsGraph: <name>, so the active graph — or a silent fallback — is visible without opening the inspector, matching howllm_openaisurfaces its model.Both checks are skipped when
allow_writesorallow_executeis on: FalkorDB creates a graph lazily on its first write, so a write-capable node may legitimately be pointed at a graph that doesn't exist yet. A strictly read-only node can never create one, so a missing graph there can only ever be a misconfiguration — which is exactly this issue's symptom.Not changed: the
agentdefault itself. The investigation flagged it as "worth questioning" but hedged rather than recommending removal, and failing closed instead would be a behavior change for every pipeline that already runs correctly against a real graph namedagent. This fix only makes an already-broken configuration fail immediately and clearly instead of later and cryptically — it does not change behavior for any pipeline that currently works.Why I picked this one up
I'd already worked through this repo's node/config patterns fixing #1986 (
ai.common.store'swriteDocuments), and this issue is the same shape: a silent, undiagnosable failure in a shared config-resolution path, with a human investigation already on the issue that narrowed the fix to two small, well-reasoned, low-risk changes. It's real (P2, confirmed against a live repro), the fix is bounded to one node, and it directly follows through on someone else's careful diagnosis rather than leaving it stranded.Test plan
nodes/test/test_graph_falkordb.py: the missing-graph raise/warn paths, the exists-so-silent paths, both write-capable skip paths (parametrized overallow_writes/allow_execute), and confirming the write-capable skip doesn't also swallow a genuine connection failure.65 passed(55 pre-existing + 10 new), run directly withpytest— this node's test file already loads the real base classes with onlyrocketlib/redis/falkordbstubbed, so no compiled engine was needed here.nodes/test/test_contracts.py:384 passed.python3 scripts/validate-node-readme.py nodes/src/nodes/graph_falkordb: PASS.ruff check/ruff format --checkclean.Summary by CodeRabbit
agentwhen left blank.