@@ -112,7 +112,10 @@ export class GitAiIntegrationService extends BaseService<GitAiIntegrationService
112112 } ) ;
113113 }
114114
115- async trackToolUse ( toolCall : PreprocessedToolCall , hookEventName : "PreToolUse" | "PostToolUse" ) : Promise < void > {
115+ async trackToolUse (
116+ toolCall : PreprocessedToolCall ,
117+ hookEventName : "PreToolUse" | "PostToolUse" ,
118+ ) : Promise < void > {
116119 try {
117120 if ( ! this . currentState . isEnabled ) {
118121 return ;
@@ -121,7 +124,7 @@ export class GitAiIntegrationService extends BaseService<GitAiIntegrationService
121124 if ( ! isFileEdit ) {
122125 return ;
123126 }
124-
127+
125128 const filePath = this . extractFilePathFromToolCall ( toolCall ) ;
126129 if ( filePath ) {
127130 if ( hookEventName === "PreToolUse" ) {
@@ -131,7 +134,11 @@ export class GitAiIntegrationService extends BaseService<GitAiIntegrationService
131134 }
132135 }
133136 } catch ( error ) {
134- logger . warn ( "git-ai tool use tracking failed" , { error, toolCall, hookEventName } ) ;
137+ logger . warn ( "git-ai tool use tracking failed" , {
138+ error,
139+ toolCall,
140+ hookEventName,
141+ } ) ;
135142 // Don't throw - allow tool use to proceed without Git AI checkpoint
136143 }
137144 }
@@ -151,8 +158,7 @@ export class GitAiIntegrationService extends BaseService<GitAiIntegrationService
151158 const sessionFilePath = getSessionFilePath ( ) ;
152159
153160 // Get current model from ModelService via serviceContainer
154- const modelState =
155- serviceContainer . getSync < ModelServiceState > ( "model" ) ;
161+ const modelState = serviceContainer . getSync < ModelServiceState > ( "model" ) ;
156162 const modelName = modelState ?. value ?. model ?. model ;
157163
158164 const hookInput : GitAiHookInput = {
@@ -194,8 +200,7 @@ export class GitAiIntegrationService extends BaseService<GitAiIntegrationService
194200 const sessionFilePath = getSessionFilePath ( ) ;
195201
196202 // Get current model from ModelService via serviceContainer
197- const modelState =
198- serviceContainer . getSync < ModelServiceState > ( "model" ) ;
203+ const modelState = serviceContainer . getSync < ModelServiceState > ( "model" ) ;
199204 const modelName = modelState ?. value ?. model ?. model ;
200205
201206 const hookInput : GitAiHookInput = {
@@ -226,14 +231,12 @@ export class GitAiIntegrationService extends BaseService<GitAiIntegrationService
226231 this . setState ( { isEnabled : enabled } ) ;
227232 }
228233
229- extractFilePathFromToolCall (
230- toolCall : PreprocessedToolCall ,
231- ) : string | null {
234+ extractFilePathFromToolCall ( toolCall : PreprocessedToolCall ) : string | null {
232235 const preprocessed = toolCall . preprocessResult ;
233236 if ( ! preprocessed ?. args ) return null ;
234-
237+
235238 const args = preprocessed . args ;
236-
239+
237240 // Extract file path based on tool type
238241 if ( toolCall . name === "Edit" && args . resolvedPath ) {
239242 return args . resolvedPath ;
@@ -242,7 +245,7 @@ export class GitAiIntegrationService extends BaseService<GitAiIntegrationService
242245 } else if ( toolCall . name === "Write" && args . filepath ) {
243246 return args . filepath ;
244247 }
245-
248+
246249 return null ;
247250 }
248251}
0 commit comments