fix(config): statically register built-in engine settings schemas at module init#983
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 23, 2026
Merged
Conversation
…module init
Fixes a ZodError ("Unsupported engine settings for claude-code") that
occurred in the router when loadConfig() ran before registerBuiltInEngines()
was called. The engine settings registry was empty at validation time because
it relied entirely on a bootstrap call that some entry points were missing.
Pre-register the three built-in schemas (claude-code, codex, opencode) in
engineSettings.ts at module initialization. Any process that imports
EngineSettingsSchema now has the schemas available automatically — no
explicit registerBuiltInEngines() call is required for config validation.
The existing registerBuiltInEngines() calls are still needed for runtime
engine dispatch (registerEngine()) and are now harmlessly idempotent for
schema registration.
Adds regression tests for claude-code engine settings acceptance in both
ProjectConfigSchema and validateConfig to prevent silent regressions if
the static registration is accidentally removed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
EngineSettingsSchemavalidated engine settings against a runtime registry (ENGINE_SETTINGS_SCHEMASMap) that was only populated whenregisterBuiltInEngines()was called at startup. The router was missing that call beforeloadConfig()ran duringverifyTrelloWebhookSignature, so the map was empty and allclaude-codeengine settings were rejected withZodError: Unsupported engine settings for "claude-code".claude-code,codex,opencode) statically inengineSettings.tsat module initialization. Any process that importsEngineSettingsSchemanow has the schemas available automatically — no explicitregisterBuiltInEngines()call required for config validation.claude-codeengine settings acceptance tests in bothProjectConfigSchemaandvalidateConfigdescribe blocks. These tests would fail if the static registration were accidentally removed.Details
The existing
registerBuiltInEngines()calls at entry points (router, dashboard, worker) are still needed for runtime engine dispatch (registerEngine()) and are now idempotently harmless for schema registration —Map.set()with the same key just overwrites.The PR #899 fix (adding
registerBuiltInEngines()tosrc/router/index.ts) stops the immediate production error. This PR makes the fix structural: schema validation can never silently break again due to a missing bootstrap call.Test plan
npm test— all 6292 unit tests passnpm run typecheck— no errorsnpm run lint— no warningsclaude-codeengine settings inProjectConfigSchemaandvalidateConfigcodexandopencodetests continue to pass (now also validated withoutregisterBuiltInEngines()dependency)🤖 Generated with Claude Code