Skip to content

Bug: Step2 environment setup can hang indefinitely when prepare fails or graph nodes have no labels #335

@Yaohua-Leo

Description

@Yaohua-Leo

Summary

On March 25, 2026, Step2 environment setup can get stuck at 配置生成中,开始轮询等待... instead of surfacing a failure state.

In my reproduction, the backend had already failed, but the frontend kept polling and never showed a clear error.

Reproduction

  1. Start the project normally.
  2. Create a project and upload source material.
  3. Finish ontology / graph generation.
  4. Enter Step2 environment setup.
  5. Observe the log sequence stops around:
    • ✓ 准备工作已完成
    • 正在加载已有配置数据...
    • 已加载 0 个Agent人设
    • 配置生成中,开始轮询等待...

Actual Behavior

  • The UI keeps waiting in Step2.
  • No actionable failure message is shown.
  • The flow looks like an infinite loading state from the user perspective.

Expected Behavior

  • If simulation prepare has failed, Step2 should stop polling and display the real failure reason.
  • The task status, simulation state, and realtime polling APIs should stay consistent.

Additional Findings

In the reproduced case:

  • state.json had already become status=failed
  • the error was: 没有找到符合条件的实体,请检查图谱是否正确构建
  • the frontend still entered config polling instead of exiting with an error

There also seems to be a second trigger condition:

  • some generated graph nodes had labels: []
  • entity filtering then returned 0 usable entities
  • this caused prepare to fail downstream

Why this matters

This is difficult for end users to diagnose because the visible symptom is just "stuck loading", while the backend has already failed.

Suggested direction

  • Treat failed prepare state as terminal in the frontend polling flow
  • Ensure prepare task status and simulation state cannot diverge
  • Consider a fallback or clearer validation when graph nodes have empty labels and entity filtering would produce 0 results

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions