From 75158caded0fe13bcea0664c9ebb1618bb4dadfa Mon Sep 17 00:00:00 2001 From: justsisyphus Date: Fri, 23 Jan 2026 14:25:59 +0900 Subject: [PATCH] fix(atlas): register tool.execute.before and pass backgroundManager - Add atlasHook?.['tool.execute.before'] call in tool.execute.before handler - Pass backgroundManager option to createAtlasHook for proper bg task checking - Move atlasHook declaration after backgroundManager initialization --- src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index f493d95cf..a09acb784 100644 --- a/src/index.ts +++ b/src/index.ts @@ -199,10 +199,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { ? createStartWorkHook(ctx) : null; - const atlasHook = isHookEnabled("atlas") - ? createAtlasHook(ctx) - : null; - const prometheusMdOnly = isHookEnabled("prometheus-md-only") ? createPrometheusMdOnlyHook(ctx) : null; @@ -211,6 +207,10 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { const backgroundManager = new BackgroundManager(ctx); + const atlasHook = isHookEnabled("atlas") + ? createAtlasHook(ctx, { directory: ctx.directory, backgroundManager }) + : null; + initTaskToastManager(ctx.client); const todoContinuationEnforcer = isHookEnabled("todo-continuation-enforcer") @@ -487,6 +487,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { await directoryReadmeInjector?.["tool.execute.before"]?.(input, output); await rulesInjector?.["tool.execute.before"]?.(input, output); await prometheusMdOnly?.["tool.execute.before"]?.(input, output); + await atlasHook?.["tool.execute.before"]?.(input, output); if (input.tool === "task") { const args = output.args as Record;