Skip to content

GML-2083: guard check_embedding_rebuilt against an unbound response during rebuild - #49

Merged
chengbiao-jin merged 1 commit into
release_2.0.1from
GML-2083-TextFile-UnboundError
Jul 24, 2026
Merged

GML-2083: guard check_embedding_rebuilt against an unbound response during rebuild#49
chengbiao-jin merged 1 commit into
release_2.0.1from
GML-2083-TextFile-UnboundError

Conversation

@prinskumar-tigergraph

@prinskumar-tigergraph prinskumar-tigergraph commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

User description

Return False and log full traceback when communities_have_desc (or embedding check) fails so the wait loop retries instead of crashing the rebuild TaskGroup.


PR Type

Bug fix


Description

  • Return false after polling failures

  • Validate polling responses before indexing

  • Log tracebacks for diagnostics


Diagram Walkthrough

flowchart LR
  A["Polling query"] -- "exception or malformed response" --> B["Log detailed error"]
  B -- "return False" --> C["Wait loop retries"]
  C -- "avoids crash" --> D["Rebuild continues safely"]
Loading

File Walkthrough

Relevant files
Bug fix
util.py
Harden rebuild polling error handling                                       

ecc/app/graphrag/util.py

  • Adds False returns after communities_have_desc query exceptions.
  • Adds False returns after vertices_have_embedding query exceptions.
  • Validates response shape before reading all_have_desc or
    all_have_embedding.
  • Logs full tracebacks and unexpected response payloads.
+24/-6   

@tg-pr-agent

tg-pr-agent Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Type Validation

The new response handling validates presence of the expected keys but not that the returned values are booleans. A malformed truthy value such as a non-empty string could cause the wait loop to treat the rebuild as complete instead of retrying.

try:
    res = resp[0]["all_have_desc"]
except (IndexError, KeyError, TypeError) as e:
    logger.error(
        f"Check Vert Desc unexpected response {resp!r}: {e!r}"
    )
    return False

logger.info(res)
return res
Type Validation

The embedding poll result is returned directly after key lookup. Consider explicitly checking that all_have_embedding is a boolean to avoid malformed truthy values prematurely ending the wait loop.

try:
    res = resp[0]["all_have_embedding"]
except (IndexError, KeyError, TypeError) as e:
    logger.error(
        f"Check embedding rebuilt unexpected response {resp!r}: {e!r}"
    )
    return False

logger.info(resp)
return res

@tg-pr-agent

tg-pr-agent Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@prinskumar-tigergraph prinskumar-tigergraph changed the title GML-2083: fix UnboundLocalError in community desc poll during rebuild GML-2083-TextFile-UnboundError : fix UnboundLocalError in community desc poll during rebuild Jul 13, 2026
Base automatically changed from release_2.0.1 to main July 24, 2026 07:23
@chengbiao-jin
chengbiao-jin changed the base branch from main to release_2.0.1 July 24, 2026 17:17
- Return False (and log with traceback) when the embedding-rebuilt poll
  query errors or returns an unexpected shape, instead of raising
  UnboundLocalError on the unbound response during a rebuild.

Refs: GML-2083
@chengbiao-jin
chengbiao-jin force-pushed the GML-2083-TextFile-UnboundError branch from b738bd4 to 83029ea Compare July 24, 2026 17:20
@chengbiao-jin chengbiao-jin changed the title GML-2083-TextFile-UnboundError : fix UnboundLocalError in community desc poll during rebuild GML-2083: guard check_embedding_rebuilt against an unbound response during rebuild Jul 24, 2026
@chengbiao-jin
chengbiao-jin merged commit 0342def into release_2.0.1 Jul 24, 2026
@chengbiao-jin
chengbiao-jin deleted the GML-2083-TextFile-UnboundError branch July 24, 2026 17:53
chengbiao-jin added a commit that referenced this pull request Jul 24, 2026
* GML-2083: guard check_embedding_rebuilt against an unbound response during rebuild (#49)

GML-2083: guard check_embedding_rebuilt against an unbound response

- Return False (and log with traceback) when the embedding-rebuilt poll
  query errors or returns an unexpected shape, instead of raising
  UnboundLocalError on the unbound response during a rebuild.

Refs: GML-2083

Co-authored-by: Chengbiao Jin <chengbiao.jin@tigergraph.com>

* GML-2162: expose classic routing prompt for customization (#51)

* GML-2088: Add regression evaluation pipeline and Apple_SEQ_10 dataset

Add evaluator.py with Planned/Reactive/Classic agent support via --agent flag
Add run_eval.sh, setup_graph.py, run_setup.sh, run_load.sh for eval workflow
Add Apple_SEQ_10 dataset (questions, answers, 4 AAPL PDFs, exported graph)
Fix agent_hallucination_check.py: langchain import updated to langchain_core
Update docker-compose.yml: volume mounts for regression and test_questions
Update requirements.txt: add deepeval==4.0.7, pin click>=8.0.0,<8.4.0

* GML-2162: route document statistics analysis to vectorstore

Keep mandatory functions routing for graph metadata; add a narrow exception for domain analysis that asks for stats instead of narrative text.

* GML-2162: expose classic question routing prompt in Customize Prompts

Split route_response like other operator-editable prompts so the routing policy (including the document-stats exception) can be customized from the UI.

* GML-2162: restore original release_2.0.1 routing policy default

Keep Question Routing UI exposure; default policy matches release_2.0.1 without the hardcoded document-stats exception.

* Scope to classic routing-prompt customization; drop 2.0.1 overrides

- Revert docker-compose.yml and agent_hallucination_check.py to main so
  this PR no longer re-introduces the regression test-folder mounts or the
  graded hallucination grader that release 2.0.1 deliberately removed.

Refs: GML-2162

---------

Co-authored-by: Prins Kumar <prins.kumar@agivant.com>
Co-authored-by: Chengbiao Jin <chengbiao.jin@tigergraph.com>

---------

Co-authored-by: prinskumar-tigergraph <prins.kumar@tigergraph.com>
Co-authored-by: Prins Kumar <prins.kumar@agivant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants