Files
sor/Server
623acf357b fix(ai): draw first then re-evaluate Main phase plan
AiPlayerSession.ExecuteTurnAsync was computing the action plan while the
game state was still in Draw phase. ActionCandidateGenerator.All returns
only [AiDrawAction] during Draw, so the plan was always [draw, end_turn] —
the AI never moved, played cards, or attacked.

Fix: when state is Draw phase, invoke game.draw immediately, reload
StateJson from the DB (post-draw Main state), then compute the full plan
with the actual hand contents. ReloadStateAsync opens a fresh scope so it
sees the committed row the draw handler just wrote.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-13 09:30:03 -04:00
..