11import type { Plugin } from "@opencode-ai/plugin"
22import { createBuiltinAgents } from "./agents"
3- import { createTodoContinuationEnforcer , createContextWindowMonitorHook , createSessionRecoveryHook } from "./hooks"
3+ import { createTodoContinuationEnforcer , createContextWindowMonitorHook , createSessionRecoveryHook , createCommentCheckerHooks } from "./hooks"
44import { updateTerminalTitle } from "./features/terminal"
55import { builtinTools } from "./tools"
66import { createBuiltinMcps } from "./mcp"
@@ -43,6 +43,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
4343 const todoContinuationEnforcer = createTodoContinuationEnforcer ( ctx )
4444 const contextWindowMonitor = createContextWindowMonitorHook ( ctx )
4545 const sessionRecovery = createSessionRecoveryHook ( ctx )
46+ const commentChecker = createCommentCheckerHooks ( )
4647
4748 updateTerminalTitle ( { sessionId : "main" } )
4849
@@ -161,7 +162,9 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
161162 }
162163 } ,
163164
164- "tool.execute.before" : async ( input , _output ) => {
165+ "tool.execute.before" : async ( input , output ) => {
166+ await commentChecker [ "tool.execute.before" ] ( input , output )
167+
165168 if ( input . sessionID === mainSessionID ) {
166169 updateTerminalTitle ( {
167170 sessionId : input . sessionID ,
@@ -175,6 +178,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
175178
176179 "tool.execute.after" : async ( input , output ) => {
177180 await contextWindowMonitor [ "tool.execute.after" ] ( input , output )
181+ await commentChecker [ "tool.execute.after" ] ( input , output )
178182
179183 if ( input . sessionID === mainSessionID ) {
180184 updateTerminalTitle ( {
0 commit comments