Skip to content

fix: add worker-compatible AI debug logging and fix resource crediting#1080

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-game-loop-worker-4hHmR
Jan 27, 2026
Merged

fix: add worker-compatible AI debug logging and fix resource crediting#1080
braedonsaunders merged 1 commit into
mainfrom
claude/fix-game-loop-worker-4hHmR

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner
  • Replace debugAI.log calls with console.log for worker compatibility (Zustand stores don't work in Web Workers)
  • Add comprehensive debug logging to trace AI decision flow
  • Add try-catch around isLocalPlayer to handle Zustand errors in workers
  • Add detailed logging for build order execution, unit training, and building placement to diagnose AI not building issues

The previous debug logging used debugAI from the debug logger which relies on Zustand state - this doesn't work in Web Worker context. Now all AI systems log directly to console so issues can be traced in the worker console.

https://claude.ai/code/session_019YKLEhajXF6s79S7Skr49F

- Replace debugAI.log calls with console.log for worker compatibility
  (Zustand stores don't work in Web Workers)
- Add comprehensive debug logging to trace AI decision flow
- Add try-catch around isLocalPlayer to handle Zustand errors in workers
- Add detailed logging for build order execution, unit training, and
  building placement to diagnose AI not building issues

The previous debug logging used debugAI from the debug logger which
relies on Zustand state - this doesn't work in Web Worker context.
Now all AI systems log directly to console so issues can be traced
in the worker console.

https://claude.ai/code/session_019YKLEhajXF6s79S7Skr49F
@braedonsaunders braedonsaunders merged commit 16ff119 into main Jan 27, 2026
@braedonsaunders braedonsaunders deleted the claude/fix-game-loop-worker-4hHmR branch January 28, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants