@@ -142,6 +142,7 @@ function Connection:connect_and_authenticate()
142142 end
143143
144144 self ._initialized = true
145+ log :debug (" [acp] Initialized (protocol_version=%s)" , initialized .protocolVersion or " unknown" )
145146
146147 api .nvim_create_autocmd (" VimLeavePre" , {
147148 group = api .nvim_create_augroup (" codecompanion.acp.disconnect" , { clear = false }),
@@ -234,6 +235,7 @@ function Connection:_authenticate()
234235 self ._authenticated = true
235236 end
236237
238+ log :debug (" [acp] Authenticated" )
237239 return true
238240end
239241
@@ -398,6 +400,7 @@ function Connection:_establish_session()
398400 apply_session_metadata (new_session , " New session" )
399401 end
400402
403+ log :debug (" [acp] Session established: %s" , self .session_id )
401404 return true
402405end
403406
@@ -518,6 +521,7 @@ function Connection:start_agent_process()
518521 end
519522
520523 self ._state .handle = sysobj
524+ log :debug (" [acp] Process started: %s" , table.concat (self .adapter_modified .command , " " ))
521525 return true
522526end
523527
913917--- @param code number
914918--- @param signal number
915919function Connection :handle_process_exit (code , signal )
920+ log :debug (" [acp] Process exited (code=%s, signal=%s)" , code , signal )
921+
916922 if self .adapter_modified and self .adapter_modified .handlers and self .adapter_modified .handlers .on_exit then
917923 self .adapter_modified .handlers .on_exit (self .adapter_modified , code )
918924 end
0 commit comments