From b558e8351b42929d8beffe1a126abd1ab38ce8d5 Mon Sep 17 00:00:00 2001 From: jimpablo <194239734+jimpablo@users.noreply.github.com> Date: Fri, 18 Sep 2026 23:58:08 +0800 Subject: [PATCH] fix(omp): report the extension status in hooks list Address the non-blocking review finding from #645: hooks list showed OMP as 'not configured' even with the teamai extension installed, because OMP has no settings/hooks path for the generic status check to parse. Add an OMP-specific row that reports the extension file itself (installed / missing), and correct the marker comment in omp-hooks.ts (doctor does not check extensions; uninstall and hooks list do). --- src/hooks-cmd.ts | 14 ++++++++++++++ src/omp-hooks.ts | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/hooks-cmd.ts b/src/hooks-cmd.ts index c98b10f8..06b89929 100644 --- a/src/hooks-cmd.ts +++ b/src/hooks-cmd.ts @@ -13,6 +13,7 @@ import { scopedToolPaths, } from './types.js'; import { getUserHome } from './utils/home.js'; +import { pathExists } from './utils/fs.js'; type HookListStatus = HookStatus | 'not configured'; @@ -95,6 +96,19 @@ export async function hooksList(_options: GlobalOptions): Promise { : paths.settings ? path.join(baseDir, paths.settings) : undefined; + // OMP has no settings/hooks file to parse: its hooks are a single + // generated extension under the user agent dir, so presence of the + // file (with our marker) is the whole status. + if (tool === 'omp') { + const { resolveOmpExtensionsDir, OMP_HOOK_FILE } = await import('./omp-hooks.js'); + const extFile = path.join(resolveOmpExtensionsDir(), OMP_HOOK_FILE); + rows.push({ + tool, + status: await pathExists(extFile) ? 'installed' : 'missing', + settingsPath: formatDisplayPath(extFile), + }); + continue; + } if (!hookPath) { rows.push({ tool, status: 'not configured', settingsPath: 'no settings configured' }); continue; diff --git a/src/omp-hooks.ts b/src/omp-hooks.ts index 30a31612..090a8af4 100644 --- a/src/omp-hooks.ts +++ b/src/omp-hooks.ts @@ -39,7 +39,7 @@ import { log } from './utils/logger.js'; /** Filename of the teamai-managed OMP extension. */ export const OMP_HOOK_FILE = 'teamai-hooks.ts'; -/** Marker so `teamai doctor` / `uninstall` can recognize our generated file. */ +/** Marker so `teamai uninstall` / `teamai hooks list` can recognize our generated file. */ const TEAMAI_MARKER = '[teamai]'; /**