From 22602da1ec416555fa2fe824cc7d716a41d01cf2 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Wed, 3 Jun 2026 08:30:21 +0800 Subject: [PATCH] fix: reduce global eslint warnings (#216) --- runners/agent-runner/src/ipc-mcp-stdio.ts | 1 - runners/agent-runner/src/verification.ts | 1 + runners/agent-runner/src/watch-ci.ts | 5 +---- setup/restart-stack.ts | 4 +++- src/db/service-handoffs.ts | 1 + src/web-dashboard-server.ts | 4 +++- src/workspace-package-manager.ts | 2 ++ 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/runners/agent-runner/src/ipc-mcp-stdio.ts b/runners/agent-runner/src/ipc-mcp-stdio.ts index 5fa5e82..3b3e1f1 100644 --- a/runners/agent-runner/src/ipc-mcp-stdio.ts +++ b/runners/agent-runner/src/ipc-mcp-stdio.ts @@ -12,7 +12,6 @@ import path from 'path'; import { CronExpressionParser } from 'cron-parser'; import { DEFAULT_SCHEDULE_TASK_CONTEXT_MODE, - DEFAULT_TASK_CONTEXT_MODE, DEFAULT_WATCH_CI_CONTEXT_MODE, EJCLAW_ENV, TASK_CONTEXT_MODES, diff --git a/runners/agent-runner/src/verification.ts b/runners/agent-runner/src/verification.ts index 4d7c662..a5c6165 100644 --- a/runners/agent-runner/src/verification.ts +++ b/runners/agent-runner/src/verification.ts @@ -153,6 +153,7 @@ export async function runVerificationRequestDirect( `Failed to parse verification response from ${pathToFileURL(helperPath).href}: ${ error instanceof Error ? error.message : String(error) }${detail ? `\n${detail}` : ''}`, + { cause: error }, ); } } diff --git a/runners/agent-runner/src/watch-ci.ts b/runners/agent-runner/src/watch-ci.ts index 44cca21..fea4a82 100644 --- a/runners/agent-runner/src/watch-ci.ts +++ b/runners/agent-runner/src/watch-ci.ts @@ -1,7 +1,4 @@ -import { - DEFAULT_WATCH_CI_CONTEXT_MODE, - WATCH_CI_PROMPT_PREFIX, -} from 'ejclaw-runners-shared'; +import { WATCH_CI_PROMPT_PREFIX } from 'ejclaw-runners-shared'; export const DEFAULT_WATCH_CI_INTERVAL_SECONDS = 60; export const MIN_WATCH_CI_INTERVAL_SECONDS = 30; diff --git a/setup/restart-stack.ts b/setup/restart-stack.ts index 70a69a3..db3c56c 100644 --- a/setup/restart-stack.ts +++ b/setup/restart-stack.ts @@ -99,7 +99,9 @@ export function restartStackServices( throw error; } if (managedServiceCaller) { - throw new Error(MANAGED_SERVICE_CALLER_FALLBACK_MESSAGE); + throw new Error(MANAGED_SERVICE_CALLER_FALLBACK_MESSAGE, { + cause: error, + }); } return restartStackServicesDirect(projectRoot, deps); diff --git a/src/db/service-handoffs.ts b/src/db/service-handoffs.ts index 3c4df03..024b7b9 100644 --- a/src/db/service-handoffs.ts +++ b/src/db/service-handoffs.ts @@ -211,6 +211,7 @@ function parseLastAgentSeqState( `Invalid last_agent_seq JSON for ${serviceId}: ${ err instanceof Error ? err.message : String(err) }`, + { cause: err }, ); } diff --git a/src/web-dashboard-server.ts b/src/web-dashboard-server.ts index bbd066b..989a05d 100644 --- a/src/web-dashboard-server.ts +++ b/src/web-dashboard-server.ts @@ -315,7 +315,9 @@ function restartEjclawStackServices(): string[] { throw error; } if (process.env.SERVICE_ID) { - throw new Error(MANAGED_SERVICE_CALLER_FALLBACK_MESSAGE); + throw new Error(MANAGED_SERVICE_CALLER_FALLBACK_MESSAGE, { + cause: error, + }); } execFileSync('systemctl', [...systemctlArgs, 'restart', ...services], { diff --git a/src/workspace-package-manager.ts b/src/workspace-package-manager.ts index ea03635..af67e75 100644 --- a/src/workspace-package-manager.ts +++ b/src/workspace-package-manager.ts @@ -507,11 +507,13 @@ export function ensureWorkspaceDependenciesInstalled( const retryDetail = getInstallErrorDetail(retryError); throw new Error( `Failed to install workspace dependencies with "${command.commandText}" in ${repoDir} after cleaning node_modules: ${retryDetail}`, + { cause: retryError }, ); } } else { throw new Error( `Failed to install workspace dependencies with "${command.commandText}" in ${repoDir}: ${detail}`, + { cause: error }, ); } }