Skip to content

fix(worker): register engine schemas at startup to fix job processing#900

Merged
zbigniewsobiecki merged 1 commit intodevfrom
fix/worker-register-engine-schemas
Mar 16, 2026
Merged

fix(worker): register engine schemas at startup to fix job processing#900
zbigniewsobiecki merged 1 commit intodevfrom
fix/worker-register-engine-schemas

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Problem

Worker containers crashed with ZodError: Unsupported engine settings for "claude-code" on any job for a project that has claude-code engine settings configured in the database.

The error occurred at:

[Worker] Unhandled error: ZodError: Unsupported engine settings for "claude-code"
  at validateConfig (file:///app/dist/config/schema.js:86:32)
  at loadConfigFromDb (...)
  at loadConfig (...)
  at main (file:///app/dist/worker-entry.js:153:20)

Root Cause

EngineSettingsSchema uses a dynamic registry (ENGINE_SETTINGS_SCHEMAS Map) populated by registerBuiltInEngines(). Without this call, any project with claude-code/codex/opencode engineSettings causes a ZodError that crashes the worker before it can process any job.

worker-entry.ts called loadConfig() without first calling registerBuiltInEngines(). The same bug was already fixed in the dashboard (#896) and router (#899).

Fix

Added registerBuiltInEngines() call in src/worker-entry.ts immediately before loadConfig(), with a comment explaining why (matching the pattern established in #896 and #899).

🤖 Generated with Claude Code

Same bug as router (#899) and dashboard (#896): worker-entry.ts calls
loadConfig() at line 253 which runs EngineSettingsSchema validation.
The dynamic ENGINE_SETTINGS_SCHEMAS registry was empty because
registerBuiltInEngines() had not yet been called — it only runs later
when createAgentRegistry() initializes.

This caused every worker container to crash immediately with:

  ZodError: Unsupported engine settings for "claude-code"

...for any project with claude-code/codex/opencode engineSettings,
making all Trello/JIRA/GitHub agent runs fail at job start.

Fix: call registerBuiltInEngines() once before loadConfig().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 279d0e6 into dev Mar 16, 2026
6 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/worker-register-engine-schemas branch March 16, 2026 13:52
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.

1 participant