Skip to content

fix(simulation): stop Step2 hanging after prepare failures (#335)#336

Open
Yaohua-Leo wants to merge 1 commit into666ghj:mainfrom
Yaohua-Leo:codex/fix-335-step2-prepare-hang
Open

fix(simulation): stop Step2 hanging after prepare failures (#335)#336
Yaohua-Leo wants to merge 1 commit into666ghj:mainfrom
Yaohua-Leo:codex/fix-335-step2-prepare-hang

Conversation

@Yaohua-Leo
Copy link
Copy Markdown

Summary

Fixes #335 by making Step2 stop on terminal prepare failures instead of hanging in config polling.

Changes

  • fail the prepare task when entity filtering yields zero usable entities, so task status and simulation state stay aligned
  • expose status, error, and profiles_generated in realtime simulation endpoints used by Step2
  • stop frontend polling immediately when realtime APIs report a failed state
  • infer coarse simulation entity types for graph nodes that have empty labels, reducing false zero-entity failures

Testing

  • GET /api/simulation/entities/mirofish_237fddbbfcd44c23 now returns filtered_count: 20 for a graph whose nodes had empty labels
  • created sim_fde532d5b129 and ran /api/simulation/prepare with entity_types=[DefinitelyMissingType]; /api/simulation/prepare/status now returns status: failed with the backend error instead of leaving Step2 in a fake-complete state
  • verified GET /api/simulation/sim_0db482d5074d/config/realtime returns status: failed, generation_stage: failed, and the real error message for the previously stuck case

Impact

  • minimal scope, only Step2 failure handling and simulation entity selection
  • no public breaking API changes; realtime endpoints only add fields consumed by the frontend

Fixes #335

- fail prepare tasks when entity filtering produces no usable entities
- expose realtime failure state and profile progress metadata
- stop Step2 polling when realtime status reports a terminal failure
- infer coarse entity types for label-less graph nodes used in simulation prep

Fixes 666ghj#335
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant