From 540a71f983df56bdca31f99dae1739eb391a33b7 Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 28 Jul 2026 15:35:43 +0700 Subject: [PATCH] fix: resolve gateway build failures - type cast + exclude archive/ - Cast llmResult through unknown to handle type mismatch between shared AnalysisResult and layer-specific local type - Exclude src/**/archive/** from tsconfig to prevent dead code errors Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/modules/ai-moderation/ai-analysis-worker.ts | 2 +- services/discord-gateway/tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/discord-gateway/src/modules/ai-moderation/ai-analysis-worker.ts b/services/discord-gateway/src/modules/ai-moderation/ai-analysis-worker.ts index 386fb24..f12d3b8 100644 --- a/services/discord-gateway/src/modules/ai-moderation/ai-analysis-worker.ts +++ b/services/discord-gateway/src/modules/ai-moderation/ai-analysis-worker.ts @@ -230,7 +230,7 @@ async function runTwoPassPipeline( return buildFallbackResult(message.id, "No LLM result returned"); } - const llmResult = moderationResult.results[0]; + const llmResult = moderationResult.results[0] as unknown as AnalysisResult; return mergeLayers(layer1Result, llmResult); } catch (error) { const errorMsg = error instanceof Error ? error.message : String(error); diff --git a/services/discord-gateway/tsconfig.json b/services/discord-gateway/tsconfig.json index f853b4b..9f8643e 100644 --- a/services/discord-gateway/tsconfig.json +++ b/services/discord-gateway/tsconfig.json @@ -20,5 +20,5 @@ } }, "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "**/*.test.ts"] + "exclude": ["node_modules", "dist", "**/*.test.ts", "src/**/archive/**"] }