@@ -189,46 +189,19 @@ export function convertMcpToolToContinueTool(mcpTool: MCPTool): Tool {
189189 } ;
190190}
191191
192- function extractFilePathFromToolCall (
193- toolCall : PreprocessedToolCall ,
194- ) : string | null {
195- const preprocessed = toolCall . preprocessResult ;
196- if ( ! preprocessed ?. args ) return null ;
197-
198- const args = preprocessed . args ;
199-
200- // Extract file path based on tool type
201- if ( toolCall . name === "Edit" && args . resolvedPath ) {
202- return args . resolvedPath ;
203- } else if ( toolCall . name === "MultiEdit" && args . file_path ) {
204- return args . file_path ;
205- } else if ( toolCall . name === "Write" && args . filepath ) {
206- return args . filepath ;
207- }
208-
209- return null ;
210- }
211-
212192export async function executeToolCall (
213193 toolCall : PreprocessedToolCall ,
214194) : Promise < string > {
215195 const startTime = Date . now ( ) ;
216- const FILE_EDIT_TOOLS = [ "Edit" , "MultiEdit" , "Write" ] ;
217- const isFileEdit = FILE_EDIT_TOOLS . includes ( toolCall . name ) ;
218196
219197 try {
220198 logger . debug ( "Executing tool" , {
221199 toolName : toolCall . name ,
222200 arguments : toolCall . arguments ,
223201 } ) ;
224202
225- // GIT-AI CHECKPOINT: Call before file editing (BLOCKING)
226- if ( isFileEdit ) {
227- const filePath = extractFilePathFromToolCall ( toolCall ) ;
228- if ( filePath ) {
229- await services . gitAiIntegration . beforeFileEdit ( filePath ) ;
230- }
231- }
203+ // Track edits if Git AI is enabled (no-op if not enabled)
204+ await services . gitAiIntegration . trackToolUse ( toolCall , "PreToolUse" ) ;
232205
233206 // IMPORTANT: if preprocessed args are present, uses preprocessed args instead of original args
234207 // Preprocessed arg names may be different
@@ -237,14 +210,8 @@ export async function executeToolCall(
237210 ) ;
238211 const duration = Date . now ( ) - startTime ;
239212
240- // GIT-AI CHECKPOINT: Call after file editing (NON-BLOCKING)
241- if ( isFileEdit ) {
242- const filePath = extractFilePathFromToolCall ( toolCall ) ;
243- if ( filePath ) {
244- // Don't await - run in background to avoid blocking
245- void services . gitAiIntegration . afterFileEdit ( filePath ) ;
246- }
247- }
213+ // Track edits if Git AI is enabled (no-op if not enabled)
214+ await services . gitAiIntegration . trackToolUse ( toolCall , "PostToolUse" ) ;
248215
249216 telemetryService . logToolResult ( {
250217 toolName : toolCall . name ,
0 commit comments