File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ async def load(self):
5959 llm = llm ,
6060 tide = await initCodeTide (workspace = self .project_path ),
6161 history = self .history ,
62- session_id = self .session_id
62+ session_id = self .session_id ,
63+ request_human_confirmation = True
6364 )
6465 self .agent_tide .llm .session_id = self .agent_tide .session_id
6566
Original file line number Diff line number Diff line change 11from codetide .core .defaults import DEFAULT_ENCODING
22
33from typing import List , Union
4+ import aiofiles .os
45import aiofiles
56import os
67import re
@@ -114,3 +115,30 @@ def parse_steps_markdown(md: str):
114115 })
115116
116117 return steps
118+
119+ async def delete_file (file_path : str ) -> bool :
120+ """
121+ Safely delete a file asynchronously.
122+
123+ Args:
124+ file_path: Path to the file to delete
125+
126+ Returns:
127+ bool: True if file was deleted, False if it didn't exist
128+
129+ Raises:
130+ PermissionError: If lacking permissions to delete
131+ OSError: For other OS-related errors
132+ """
133+ try :
134+ await aiofiles .os .remove (file_path )
135+ return True
136+ except FileNotFoundError :
137+ # File doesn't exist - consider this "success"
138+ return False
139+ except PermissionError :
140+ # Handle permission issues
141+ raise
142+ except OSError :
143+ # Handle other OS errors (disk full, etc.)
144+ raise
You can’t perform that action at this time.
0 commit comments