Skip to content

Fix daily-rig-game-gen timeout caused by spurious typecheck failures on optional engines - #375

Merged
pelikhan merged 2 commits into
mainfrom
copilot/aw-fix-daily-rig-game-generator-timeout
Aug 8, 2026
Merged

Fix daily-rig-game-gen timeout caused by spurious typecheck failures on optional engines#375
pelikhan merged 2 commits into
mainfrom
copilot/aw-fix-daily-rig-game-generator-timeout

Conversation

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

The Daily Rig Game Generator workflow timed out at 30 minutes (#374). The agent transcript from the failed run shows it stuck for 27+ minutes debugging a --typecheck failure that was unrelated to the generated game code, on every single attempt.

Root cause

rig.ts's defaultAgentFactory lazy-loads the optional anthropic/codex/gemini engines via literal dynamic imports:

const { anthropicEngine } = await import("./engines/anthropic.ts");

TypeScript fully type-checks the module graph reachable from a literal dynamic import specifier, even when that branch is only reached at runtime for a specific engine selection. Since the workflow installs the rig skill standalone (no repo checkout, no npm install), the optional peer deps (@anthropic-ai/sdk, @openai/codex-sdk) are missing, so every --typecheck call failed with:

engines/anthropic.ts(1,23): error TS2307: Cannot find module '@anthropic-ai/sdk' ...
engines/codex.ts(1,23): error TS2307: Cannot find module '@openai/codex-sdk' ...

The agent had no way to fix this (it can't modify the skill's engine files), so it kept regenerating and re-verifying the game program across many attempts until the job was cancelled.

Fix

  • skills/rig/rig.ts: route the anthropic/codex/gemini dynamic imports through a new importOptionalEngine(relativePath) helper that passes the specifier via a parameter instead of a literal string:

    async function importOptionalEngine(relativePath: string): Promise<any> {
      return import(relativePath);
    }

    TypeScript cannot statically resolve non-literal dynamic import specifiers, so it treats the result as any and skips transitively type-checking those optional engine modules. Runtime behavior is unchanged — the engines still load correctly when selected.

Tests

  • src/launcher.test.ts: added a regression test that simulates a standalone skill install (skill directory copied to a temp dir, node_modules symlinked in minus the optional engine peer deps) and asserts --typecheck still passes.

Copilot AI linked an issue Aug 8, 2026 that may be closed by this pull request
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix daily rig game generator timeout issue Fix daily-rig-game-gen timeout caused by spurious typecheck failures on optional engines Aug 8, 2026
Copilot AI requested a review from pelikhan August 8, 2026 20:51
@pelikhan
pelikhan marked this pull request as ready for review August 8, 2026 20:52
@pelikhan
pelikhan merged commit e7d6ad8 into main Aug 8, 2026
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.

[aw] Daily Rig Game Generator timed out

2 participants