Update gitea/dev.py #8

Merged
xcaliber merged 1 commits from xcaliber-patch-1 into main 2026-01-15 20:43:12 +00:00
Showing only changes of commit 6254819952 - Show all commits

View File

@@ -6,6 +6,8 @@ license: MIT
description: Interact with Gitea repositories - native tool calling optimized for high-tier LLMs with robust error handling
requirements: pydantic, httpx
changelog:
1.4.2:
- Fixed renamed update_file to replace file, as update implied diff
1.4.1:
- Fixed redundant __user__ checks in _get_token, _get_repo, _get_branch, _get_org
- Fixed merge_pull_request: proper conflict detection, merged status check, and empty response handling
@@ -555,7 +557,7 @@ class Tools:
f"Error: Unexpected failure during file fetch: {type(e).__name__}: {e}"
)
async def update_file(
async def replace_file(
self,
path: str,
content: str,
@@ -738,7 +740,7 @@ class Tools:
except httpx.HTTPStatusError as e:
error_msg = self._format_error(e, f"file creation for '{path}'")
if e.response.status_code == 422:
return f"Error: File already exists: `{path}`. Use `update_file()` to modify it instead."
return f"Error: File already exists: `{path}`. Use `replace_file()` to modify it instead."
return f"Error: Failed to create file. {error_msg}"
except Exception as e:
return f"Error: Unexpected failure during file creation: {type(e).__name__}: {e}"