Creating a simulation was not idempotent: each POST /api/simulation/create minted a fresh sim_<uuid>. The frontend wraps createSimulation in requestWithRetry(..., 3, 1000), so a slow/timed-out first request triggers a retry that creates a second identical simulation for the same project+graph (observed: two sims created ~2s apart). Guard against this by reusing an existing, not-yet-run simulation for the same project_id + graph_id (and matching platform flags) when status is CREATED/PREPARING/READY and current_round == 0. A force_new=True escape hatch preserves the ability to intentionally create a fresh simulation. Verified: repeated /create calls now return the same simulation_id instead of spawning duplicates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| graph_builder.py | ||
| oasis_profile_generator.py | ||
| ontology_generator.py | ||
| report_agent.py | ||
| simulation_config_generator.py | ||
| simulation_ipc.py | ||
| simulation_manager.py | ||
| simulation_runner.py | ||
| text_processor.py | ||
| zep_entity_reader.py | ||
| zep_graph_memory_updater.py | ||
| zep_tools.py | ||