From 9d64f213eef8b8ba46538dabd457c83b815b2560 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sun, 4 Jan 2026 21:16:49 +0900 Subject: [PATCH] perf(init): use background tmux path check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Call startTmuxCheck() at plugin initialization instead of blocking await - Remove tmuxAvailable check, always include interactive_bash tool - Tool gracefully handles missing tmux via getCachedTmuxPath() ?? "tmux" 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 20a7618..8d5c0f6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -54,7 +54,7 @@ import { createSkillMcpTool, sessionExists, interactive_bash, - getTmuxPath, + startTmuxCheck, } from "./tools"; import { BackgroundManager } from "./features/background-agent"; import { SkillMcpManager } from "./features/skill-mcp-manager"; @@ -65,6 +65,9 @@ import { createModelCacheState, getModelLimit } from "./plugin-state"; import { createConfigHandler } from "./plugin-handlers"; const OhMyOpenCodePlugin: Plugin = async (ctx) => { + // Start background tmux check immediately + startTmuxCheck(); + const pluginConfig = loadPluginConfig(ctx.directory, ctx); const disabledHooks = new Set(pluginConfig.disabled_hooks ?? []); const isHookEnabled = (hookName: HookName) => !disabledHooks.has(hookName); @@ -219,12 +222,9 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { getSessionID: getSessionIDForMcp, }); - const [googleAuthHooks, tmuxAvailable] = await Promise.all([ - pluginConfig.google_auth !== false - ? createGoogleAntigravityAuthPlugin(ctx) - : Promise.resolve(null), - getTmuxPath(), - ]); + const googleAuthHooks = pluginConfig.google_auth !== false + ? await createGoogleAntigravityAuthPlugin(ctx) + : null; const configHandler = createConfigHandler({ ctx, @@ -242,7 +242,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { look_at: lookAt, skill: skillTool, skill_mcp: skillMcpTool, - ...(tmuxAvailable ? { interactive_bash } : {}), + interactive_bash, // Always included, handles missing tmux gracefully via getCachedTmuxPath() ?? "tmux" }, "chat.message": async (input, output) => {