Skip to content

Commit 90a06b5

Browse files
author
wangjichao
committed
refactor: use centralized WRITE_QUERY_MODE_BLOCKED constant in FileWriter
1 parent b23a868 commit 90a06b5

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

codebase_rag/tool_errors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
CODE_ENTITY_NOT_FOUND = "Entity not found in graph."
5050
CODE_MISSING_LOCATION = "Graph entry is missing location data."
5151

52+
# (H) Tool operation errors
53+
WRITE_QUERY_MODE_BLOCKED = "Write operations are not allowed in query mode"
54+
5255
# (H) File writer errors
5356
FILE_WRITER_SECURITY = (
5457
"Security risk: Attempted to create file outside of project root: {path}"

codebase_rag/tools/file_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def _create_validated(
3333
return FileCreationResult(
3434
file_path=str(file_path),
3535
success=False,
36-
error_message="Write operations are not allowed in query mode",
36+
error_message=te.WRITE_QUERY_MODE_BLOCKED,
3737
)
3838

3939
try:

0 commit comments

Comments
 (0)