From c0fb8146580f3f759c66d3ac94ac80b99373230c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 27 Dec 2025 04:02:13 +0100 Subject: [PATCH] fix: normalize imports for lint --- src/auto-reply/reply.directive.test.ts | 30 +++++++++++++------------- src/auto-reply/reply.ts | 19 ++++++++++------ 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/auto-reply/reply.directive.test.ts b/src/auto-reply/reply.directive.test.ts index e7f364929..3cef1bb1c 100644 --- a/src/auto-reply/reply.directive.test.ts +++ b/src/auto-reply/reply.directive.test.ts @@ -4,6 +4,21 @@ import path from "node:path"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { loadModelCatalog } from "../agents/model-catalog.js"; +import { runEmbeddedPiAgent } from "../agents/pi-embedded.js"; +import { + loadSessionStore, + resolveSessionKey, + saveSessionStore, +} from "../config/sessions.js"; +import { drainSystemEvents } from "../infra/system-events.js"; +import { + extractQueueDirective, + extractThinkDirective, + extractVerboseDirective, + getReplyFromConfig, +} from "./reply.js"; + vi.mock("../agents/pi-embedded.js", () => ({ abortEmbeddedPiRun: vi.fn().mockReturnValue(false), runEmbeddedPiAgent: vi.fn(), @@ -15,21 +30,6 @@ vi.mock("../agents/model-catalog.js", () => ({ loadModelCatalog: vi.fn(), })); -import { loadModelCatalog } from "../agents/model-catalog.js"; -import { runEmbeddedPiAgent } from "../agents/pi-embedded.js"; -import { - loadSessionStore, - resolveSessionKey, - saveSessionStore, -} from "../config/sessions.js"; -import { - extractQueueDirective, - extractThinkDirective, - extractVerboseDirective, - getReplyFromConfig, -} from "./reply.js"; -import { drainSystemEvents } from "../infra/system-events.js"; - async function withTempHome(fn: (home: string) => Promise): Promise { const base = await fs.mkdtemp(path.join(os.tmpdir(), "clawdis-reply-")); const previousHome = process.env.HOME; diff --git a/src/auto-reply/reply.ts b/src/auto-reply/reply.ts index d8d40a373..c612ddc1e 100644 --- a/src/auto-reply/reply.ts +++ b/src/auto-reply/reply.ts @@ -39,8 +39,10 @@ import { import { logVerbose } from "../globals.js"; import { buildProviderSummary } from "../infra/provider-summary.js"; import { triggerClawdisRestart } from "../infra/restart.js"; -import { enqueueSystemEvent } from "../infra/system-events.js"; -import { drainSystemEvents } from "../infra/system-events.js"; +import { + drainSystemEvents, + enqueueSystemEvent, +} from "../infra/system-events.js"; import { clearCommandLane, getQueueSize } from "../process/command-queue.js"; import { defaultRuntime } from "../runtime.js"; import { normalizeE164 } from "../utils.js"; @@ -549,7 +551,9 @@ export async function getReplyFromConfig( const initialModelLabel = `${provider}/${model}`; const formatModelSwitchEvent = (label: string, alias?: string) => - alias ? `Model switched to ${alias} (${label}).` : `Model switched to ${label}.`; + alias + ? `Model switched to ${alias} (${label}).` + : `Model switched to ${label}.`; const directiveOnly = (() => { if ( @@ -646,9 +650,12 @@ export async function getReplyFromConfig( }; const nextLabel = `${modelSelection.provider}/${modelSelection.model}`; if (nextLabel !== initialModelLabel) { - enqueueSystemEvent(formatModelSwitchEvent(nextLabel, modelSelection.alias), { - contextKey: `model:${nextLabel}`, - }); + enqueueSystemEvent( + formatModelSwitchEvent(nextLabel, modelSelection.alias), + { + contextKey: `model:${nextLabel}`, + }, + ); } }