Skip to content

Claude/fix ai command error zrx zq#1194

Merged
braedonsaunders merged 2 commits into
mainfrom
claude/fix-ai-command-error-zrxZQ
Jan 31, 2026
Merged

Claude/fix ai command error zrx zq#1194
braedonsaunders merged 2 commits into
mainfrom
claude/fix-ai-command-error-zrxZQ

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

No description provided.

The AI systems (AITacticsManager, AIScoutingManager, AIMicroSystem) call
this.game.issueAICommand() but the method was only defined in Game.ts
(main thread), not in GameCore (base class). When running in a worker
context, WorkerGame extends GameCore directly and lacked this method,
causing "this.game.issueAICommand is not a function" errors.

Added issueAICommand to GameCore so it's available in both:
- Main thread (Game class - with multiplayer command recording override)
- Worker (WorkerGame class - uses base implementation)

https://claude.ai/code/session_01T24MdL2bd5Tyb6PxJnyFgZ
The override was bypassing Game.processCommand to skip authorization,
but AI commands pass authorization anyway (AI controls AI-owned units).
Game.processCommand already records commands in multiplayer mode.

Now the base GameCore.issueAICommand handles all cases cleanly:
- Calls this.processCommand() which polymorphically routes to the correct impl
- Worker: Uses GameCore.processCommand directly (no network recording needed)
- Main thread: Uses Game.processCommand (records for sync responses)

https://claude.ai/code/session_01T24MdL2bd5Tyb6PxJnyFgZ
@braedonsaunders braedonsaunders merged commit c814eb3 into main Jan 31, 2026
4 checks passed
@braedonsaunders braedonsaunders deleted the claude/fix-ai-command-error-zrxZQ branch January 31, 2026 05:08
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