Fix daily-rig-game-gen timeout caused by spurious typecheck failures on optional engines - #375
Merged
Merged
Conversation
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
pelikhan
marked this pull request as ready for review
August 8, 2026 20:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
--typecheckfailure that was unrelated to the generated game code, on every single attempt.Root cause
rig.ts'sdefaultAgentFactorylazy-loads the optional anthropic/codex/gemini engines via literal dynamic imports: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
rigskill standalone (no repo checkout, nonpm install), the optional peer deps (@anthropic-ai/sdk,@openai/codex-sdk) are missing, so every--typecheckcall failed with: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 newimportOptionalEngine(relativePath)helper that passes the specifier via a parameter instead of a literal string:TypeScript cannot statically resolve non-literal dynamic import specifiers, so it treats the result as
anyand 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_modulessymlinked in minus the optional engine peer deps) and asserts--typecheckstill passes.