Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion codetide/agents/tide/ui/agent_tide_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ async def load(self):
llm=llm,
tide=await initCodeTide(workspace=self.project_path),
history=self.history,
session_id=self.session_id
session_id=self.session_id,
request_human_confirmation=True
)
self.agent_tide.llm.session_id = self.agent_tide.session_id

Expand Down
28 changes: 28 additions & 0 deletions codetide/agents/tide/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from codetide.core.defaults import DEFAULT_ENCODING

from typing import List, Union
import aiofiles.os
import aiofiles
import os
import re
Expand Down Expand Up @@ -114,3 +115,30 @@ def parse_steps_markdown(md: str):
})

return steps

async def delete_file(file_path: str) -> bool:
"""
Safely delete a file asynchronously.

Args:
file_path: Path to the file to delete

Returns:
bool: True if file was deleted, False if it didn't exist

Raises:
PermissionError: If lacking permissions to delete
OSError: For other OS-related errors
"""
try:
await aiofiles.os.remove(file_path)
return True
except FileNotFoundError:
# File doesn't exist - consider this "success"
return False
except PermissionError:
# Handle permission issues
raise
except OSError:
# Handle other OS errors (disk full, etc.)
raise