happy-sim-diagnose
Troubleshoot a broken or misbehaving simulation
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Troubleshoot a broken or misbehaving simulation
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Run ruff linter and formatter on the project
Add observability (probes, trackers, charts) to a simulation
Analyze simulation results and provide insights
Help choose the right happysimulator components for a use case
Walk through a library example with detailed explanation
Generate a complete simulation from a high-level description
| name | happy-sim-diagnose |
| description | Troubleshoot a broken or misbehaving simulation |
Find and fix common issues in happysimulator code.
Ask the user which file to diagnose if not specified. Also ask what the symptom is (e.g., "nothing happens", "queue grows forever", "error on run").
Read the simulation file thoroughly.
Check for these common issues, in priority order:
| Issue | What to look for | Fix |
|---|---|---|
| Missing target | Event(...) without target= | Add target=<entity> or use Event.once() |
| Unregistered entity | Entity created but not in Simulation(entities=[...]) | Add to entities list |
| Raw float as time | Event(time=1.0, ...) instead of Instant.from_seconds(1.0) | Wrap with Instant.from_seconds() |
| Import errors | Importing from wrong module path | Check happysimulator/__init__.py — most things import from top level |
| Issue | What to look for | Fix |
|---|---|---|
| Queue never fills | QueuedResource without has_capacity() override | Override has_capacity() to return False when at capacity |
| Unbounded queue growth | Arrival rate >= service rate | Reduce arrival rate or increase service capacity |
| Generator not progressing | Yielding Instant instead of float seconds | yield 0.1 not yield Instant.from_seconds(0.1) |
| Events returned instead of yielded | yield [Event(...)] in middle of generator | Use yield delay, [events] for mid-generator events; return [events] only at end |
| Source event double-counting | Checking events_processed against expected count | Source generates ~2x events (user events + self-scheduling). Check entity-level counters instead |
| SimFuture never resolves | Creating future but nobody calls future.resolve(value) | Ensure the target entity calls future.resolve() in its handler |
| SimFuture double-yield | Same future yielded by two generators | Each SimFuture can only be yielded by one generator |
| No events generated | Source.constant(rate=1) with stop_after=0.5 | First event at t=1/rate. Use higher rate or longer stop_after |
| Issue | What to look for | Fix |
|---|---|---|
| Slow simulation | Very high event rate or very long end_time | Reduce rate, shorten duration, or use coarser time granularity |
| Memory growth | Unbounded queue + long simulation | Add capacity limits, use BalkingQueue, or reduce arrival rate |
If the issue isn't obvious from static analysis, run the simulation:
python <file>
Analyze the output for clues (error tracebacks, unexpected metric values, suspiciously fast completion).
Report findings clearly:
If no issues are found, say so and suggest adding instrumentation (/happy-sim-add-instrumentation) to investigate further.