From 88c615ee975428537ca73e64256f7d3afc25b671 Mon Sep 17 00:00:00 2001 From: ismeth Date: Sun, 1 Mar 2026 19:38:37 +0100 Subject: [PATCH] fix(prepare-council-prompt): suppress ENOENT in cleanup timer and eliminate redundant resolveCouncilIntent Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/tools/prepare-council-prompt/tools.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tools/prepare-council-prompt/tools.ts b/src/tools/prepare-council-prompt/tools.ts index e48c67667..0a24a5a18 100644 --- a/src/tools/prepare-council-prompt/tools.ts +++ b/src/tools/prepare-council-prompt/tools.ts @@ -84,16 +84,16 @@ Returns the file path to reference in subsequent task() calls.` return `Invalid mode: "${args.mode}". Valid modes: "solo", "delegation".` } + let resolvedIntent: CouncilIntent | undefined if (args.intent !== undefined) { const resolved = resolveCouncilIntent(args.intent) if (!resolved) { const validIntents = getValidCouncilIntents() return `Invalid intent: "${args.intent}". Valid intents: ${validIntents.map((i) => `"${i}"`).join(", ")}.` } + resolvedIntent = resolved } - const resolvedIntent = args.intent ? resolveCouncilIntent(args.intent) : undefined - const mode = args.mode === "delegation" ? "delegation" : "solo" try { @@ -113,7 +113,10 @@ Returns the file path to reference in subsequent task() calls.` setTimeout(() => { unlink(filePath).catch((err) => { - log("[prepare-council-prompt] Failed to clean up temp file", { filePath, error: String(err) }) + const code = (err as NodeJS.ErrnoException).code + if (code !== "ENOENT") { + log("[prepare-council-prompt] Failed to clean up temp file", { filePath, error: String(err) }) + } }) }, CLEANUP_DELAY_MS)