|
9 | 9 | from automation.agents.utils import find_original_snippet |
10 | 10 | from automation.utils import check_file_read, get_file_change, get_file_changes, register_file_change |
11 | 11 | from codebase.base import FileChangeAction |
12 | | -from codebase.context import get_repository_ctx |
| 12 | +from codebase.context import get_runtime_ctx |
13 | 13 |
|
14 | 14 | logger = logging.getLogger("daiv.tools") |
15 | 15 |
|
@@ -51,7 +51,7 @@ async def edit_tool( |
51 | 51 | """ # noqa: E501 |
52 | 52 | logger.debug("[%s] Editing file '%s'", edit_tool.name, file_path) |
53 | 53 |
|
54 | | - ctx = get_repository_ctx() |
| 54 | + ctx = get_runtime_ctx() |
55 | 55 | resolved_file_path = (ctx.repo_dir / file_path).resolve() |
56 | 56 |
|
57 | 57 | if not resolved_file_path.exists() or not resolved_file_path.is_file(): |
@@ -121,7 +121,7 @@ async def write_tool(file_path: str, content: str, store: Annotated[Any, Injecte |
121 | 121 | """ # noqa: E501 |
122 | 122 | logger.debug("[%s] Writing to file '%s'", write_tool.name, file_path) |
123 | 123 |
|
124 | | - ctx = get_repository_ctx() |
| 124 | + ctx = get_runtime_ctx() |
125 | 125 | resolved_file_path = (ctx.repo_dir / file_path).resolve() |
126 | 126 | file_exists = resolved_file_path.exists() |
127 | 127 |
|
@@ -171,7 +171,7 @@ async def delete_tool(file_path: str, store: Annotated[Any, InjectedStore()] = N |
171 | 171 | """ # noqa: E501 |
172 | 172 | logger.debug("[%s] Deleting file '%s'", delete_tool.name, file_path) |
173 | 173 |
|
174 | | - ctx = get_repository_ctx() |
| 174 | + ctx = get_runtime_ctx() |
175 | 175 | resolved_file_path = (ctx.repo_dir / file_path).resolve() |
176 | 176 |
|
177 | 177 | if not resolved_file_path.exists() or not resolved_file_path.is_file(): |
@@ -221,7 +221,7 @@ async def rename_tool(file_path: str, new_file_path: str, store: Annotated[Any, |
221 | 221 | """ # noqa: E501 |
222 | 222 | logger.debug("[%s] Renaming file '%s' to '%s'", rename_tool.name, file_path, new_file_path) |
223 | 223 |
|
224 | | - ctx = get_repository_ctx() |
| 224 | + ctx = get_runtime_ctx() |
225 | 225 |
|
226 | 226 | resolved_file_path = (ctx.repo_dir / file_path).resolve() |
227 | 227 | resolved_new_file_path = (ctx.repo_dir / new_file_path).resolve() |
|
0 commit comments