perf(init): use background tmux path check

- 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)
This commit is contained in:
YeonGyu-Kim
2026-01-04 21:16:49 +09:00
parent e572c7c321
commit 9d64f213ee

View File

@@ -54,7 +54,7 @@ import {
createSkillMcpTool, createSkillMcpTool,
sessionExists, sessionExists,
interactive_bash, interactive_bash,
getTmuxPath, startTmuxCheck,
} from "./tools"; } from "./tools";
import { BackgroundManager } from "./features/background-agent"; import { BackgroundManager } from "./features/background-agent";
import { SkillMcpManager } from "./features/skill-mcp-manager"; import { SkillMcpManager } from "./features/skill-mcp-manager";
@@ -65,6 +65,9 @@ import { createModelCacheState, getModelLimit } from "./plugin-state";
import { createConfigHandler } from "./plugin-handlers"; import { createConfigHandler } from "./plugin-handlers";
const OhMyOpenCodePlugin: Plugin = async (ctx) => { const OhMyOpenCodePlugin: Plugin = async (ctx) => {
// Start background tmux check immediately
startTmuxCheck();
const pluginConfig = loadPluginConfig(ctx.directory, ctx); const pluginConfig = loadPluginConfig(ctx.directory, ctx);
const disabledHooks = new Set(pluginConfig.disabled_hooks ?? []); const disabledHooks = new Set(pluginConfig.disabled_hooks ?? []);
const isHookEnabled = (hookName: HookName) => !disabledHooks.has(hookName); const isHookEnabled = (hookName: HookName) => !disabledHooks.has(hookName);
@@ -219,12 +222,9 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
getSessionID: getSessionIDForMcp, getSessionID: getSessionIDForMcp,
}); });
const [googleAuthHooks, tmuxAvailable] = await Promise.all([ const googleAuthHooks = pluginConfig.google_auth !== false
pluginConfig.google_auth !== false ? await createGoogleAntigravityAuthPlugin(ctx)
? createGoogleAntigravityAuthPlugin(ctx) : null;
: Promise.resolve(null),
getTmuxPath(),
]);
const configHandler = createConfigHandler({ const configHandler = createConfigHandler({
ctx, ctx,
@@ -242,7 +242,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
look_at: lookAt, look_at: lookAt,
skill: skillTool, skill: skillTool,
skill_mcp: skillMcpTool, skill_mcp: skillMcpTool,
...(tmuxAvailable ? { interactive_bash } : {}), interactive_bash, // Always included, handles missing tmux gracefully via getCachedTmuxPath() ?? "tmux"
}, },
"chat.message": async (input, output) => { "chat.message": async (input, output) => {