Skip to content

cluster-only skips labeling batch on JSON parse error without retry or chunk split (inconsistent with extract) #1278

Closed

Description

@sub4biz

Version

0.8.38

Steps to reproduce

Run cluster-only on a large graph (e.g. 121k nodes, 135 labeling batches):

graphify cluster-only <path>

What happened

During community labeling, one batch failed with a JSON parse error:

[graphify label] batch N/M failed:
Expecting property name enclosed in double quotes: line 8 column 40 (char 242)

The error is logged but the batch is skipped without retry or chunk split. The final output says "Done" without indicating that some batches failed.

Expected behavior

extract already handles this case correctly - when the LLM returns invalid JSON, it splits the chunk into halves and retries:

[graphify] LLM returned invalid JSON, skipping chunk (first 200 chars: ...)
[graphify] chunk of 10 truncated at depth 0, splitting into halves of 5 and 5

cluster-only labeling should apply the same split-and-retry logic for consistency and to avoid silently incomplete community names.

Suggested fix

Reuse the existing invalid-JSON handler from the extract path in the label/cluster-only labeling loop.

Environment

  • OS: Windows 11
  • graphify: 0.8.38
  • Install method: uv tool install graphifyy[gemini]
  • Graph size: 121,500 nodes, 13,409 communities, 135 labeling batches

Activity

  1. safishamsi commented on Jun 18, 2026

    @safishamsi
    Member

    Fixed by #1380 (commit ab1e0ec on v8): community labeling now splits a malformed-JSON batch and retries each half, mirroring the extract path, instead of silently dropping ~100 names per failed batch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions