From 75557b2a324ac3fdcfefe4edb1be1b8b9651093f Mon Sep 17 00:00:00 2001 From: Zbigniew Sobiecki Date: Mon, 16 Mar 2026 13:34:03 +0000 Subject: [PATCH] fix(router): register engine schemas at startup to fix webhook processing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The router's loadProjectConfig() calls validateConfig() which runs EngineSettingsSchema — a Zod schema that validates against a dynamic registry populated by registerBuiltInEngines(). Without calling registerBuiltInEngines() at startup, any project with claude-code, codex, or opencode engineSettings configured causes a ZodError: Unsupported engine settings for "claude-code" This error is thrown inside TrelloRouterAdapter.parseWebhook() and JiraRouterAdapter.parseWebhook(), which return null on any unhandled exception — so all webhooks for affected projects are silently dropped with no job enqueued and no agent triggered. Fix: call registerBuiltInEngines() once at router startup, before any request handler runs. Identical to the dashboard fix in #896. Affected projects: any project with per-project engineSettings using claude-code, codex, or opencode backend. Co-Authored-By: Claude Sonnet 4.6 --- src/router/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/router/index.ts b/src/router/index.ts index 1970af6a..61e9a1b0 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -4,6 +4,7 @@ import { captureException, flush, setTag } from '../sentry.js'; // Bootstrap PM integrations before any adapters are loaded import '../pm/bootstrap.js'; import { initPrompts } from '../agents/prompts/index.js'; +import { registerBuiltInEngines } from '../backends/bootstrap.js'; import { initAgentMessages } from '../config/agentMessages.js'; import { seedAgentDefinitions } from '../db/seeds/seedAgentDefinitions.js'; import { registerBuiltInTriggers } from '../triggers/builtins.js'; @@ -34,6 +35,12 @@ import { setTag('role', 'router'); +// Register engine settings schemas before any loadConfig() call. +// EngineSettingsSchema uses a dynamic registry; without this, any project +// with claude-code/codex/opencode engineSettings causes a ZodError that +// silently drops all webhooks (same fix as dashboard.ts in #896). +registerBuiltInEngines(); + // Create trigger registry once at router startup for dispatch() calls const triggerRegistry = createTriggerRegistry(); registerBuiltInTriggers(triggerRegistry);