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
TypeError in export wiki: '<' not supported between str and NoneType when source_file is None #1016
File ".../graphify/wiki.py", line 57, in _community_article
sources = sorted({G.nodes[n].get("source_file", "") for n in nodes} - {""})
TypeError: '<' not supported between instances of 'str' and 'NoneType'
Root Cause
Some nodes in graph.json have source_file: null (not "" or missing key). The set comprehension uses .get("source_file", "") which only applies the default for missing keys — when the key exists with value null/None, it returns None. Subtracting {""} does not remove None, so sorted({"a", None, "b"}) raises TypeError.
This happens after an incremental extraction where some semantic chunks fail mid-run (e.g. credit exhaustion, rate limit), leaving partially-extracted nodes with source_file=None.
Using or "" coerces both None and "" to "", which is then removed by - {""}. Sorting the result is always safe.
Workaround applied locally
Patched wiki.py in the venv as above. graphify export wiki now runs successfully with the patched version.
Reproducibility
Trigger a full extraction (graphify . --backend claude) and force an early abort (e.g. exhaust API credits mid-run). Some nodes will have source_file: null in the resulting graph.json. Then run graphify export wiki — it crashes.
Activity
Fix wiki TypeError on null source_file and skip nested worktrees/ dirs (
safishamsi commentedon May 26, 2026
Fixed in 4e80d86 — changed
.get('source_file', '')to(... or '')in wiki.py soNonevalues are normalized beforesorted()is called.Fix wiki TypeError on null source_file and skip nested worktrees/ dirs (