Graphify-Labs/graphify · error · RuntimeError

graph.json {p} is {size} bytes, exceeds {_MERGE_MAX_BYTES}-b

Error message

graph.json {p} is {size} bytes, exceeds {_MERGE_MAX_BYTES}-byte cap

What it means

Graph-existence preflight in the devin fragment's /graphify ask flow (tools/skillgen/fragments/core/devin.md:1076). Before traversing the graph for a question, the skill checks graphify-out/graph.json exists and exits 1 with this message otherwise, preventing a confusing downstream load failure.

Source

Thrown at graphify/cli.py:2246

            print("Usage: graphify merge-driver <base> <current> <other>", file=sys.stderr)
            sys.exit(1)
        _base_path, _current_path, _other_path = sys.argv[2], sys.argv[3], sys.argv[4]
        # Hard caps so a malicious or corrupted graph.json cannot exhaust memory
        # at parse time. 50 MB / 100k nodes are well above any realistic graph
        # (typical graphs are <5 MB / <50k nodes); anything larger should fail
        # the merge so a human can investigate.
        _MERGE_MAX_BYTES = 50 * 1024 * 1024
        _MERGE_MAX_NODES = 100_000
        import networkx as _nx
        from networkx.readwrite import json_graph as _jg
        def _load_graph(p: str):
            path_obj = Path(p)
            try:
                size = path_obj.stat().st_size
            except OSError as exc:
                raise RuntimeError(f"cannot stat {p}: {exc}") from exc
            if size > _MERGE_MAX_BYTES:
                raise RuntimeError(
                    f"graph.json {p} is {size} bytes, exceeds {_MERGE_MAX_BYTES}-byte cap"
                )
            data = json.loads(path_obj.read_text(encoding="utf-8"))
            # A committed raw (--no-cluster) graph stores edges under "edges";
            # parse via the shared links/edges-normalizing loader (#2212).
            from graphify.paths import load_node_link_graph as _lnlg
            return _lnlg(data), data
        try:
            G_cur, _ = _load_graph(_current_path)
            G_oth, _ = _load_graph(_other_path)
        except Exception as exc:
            print(f"[graphify merge-driver] error loading graphs: {exc}", file=sys.stderr)
            sys.exit(1)  # surface the conflict so git doesn't accept a corrupt merge
        merged = _nx.compose(G_cur, G_oth)
        if merged.number_of_nodes() > _MERGE_MAX_NODES:
            print(
                f"[graphify merge-driver] merged graph has {merged.number_of_nodes()} nodes, "
                f"exceeds {_MERGE_MAX_NODES}-node cap; aborting merge.",

View on GitHub (pinned to 7fe58b0b0f)

Solutions

  1. Run /graphify <path> to build the graph first.
  2. Make sure the query runs from the directory containing graphify-out/.
  3. Resolve any earlier build failure that prevented graph.json from being written.
  4. Rebuild after any process that deletes graphify-out/.

Example fix

# before
/graphify ask "how do retries work?"
# ERROR: No graph found ...

# after
/graphify .
/graphify ask "how do retries work?"
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

if not Path('graphify-out/graph.json').is_file():
    print('graph missing - run /graphify <path> first')
else:
    print('graph ready for ask traversal')

Prevention

When it happens

Trigger: Asking a graph question when graphify-out/graph.json is missing in the current working tree: no build ever ran, the graph was built in another directory, cleanup removed it, or a previous build exited before export.

Common situations: New workspace/clone; agent cwd mismatch; git clean or CI removed graphify-out/; prior build aborted at the empty-graph or shrink guard.

Related errors


AI-assisted analysis of Graphify-Labs/graphify@7fe58b0b0f (2026-08-14). Data as JSON: /api/errors/81a6e95d461ace71. Report an issue: GitHub.