Code improvements

This commit is contained in:
mijauexe
2025-02-10 15:51:56 +01:00
parent fb0655ba50
commit ce3304d515
2 changed files with 4 additions and 6 deletions

View File

@@ -204,8 +204,8 @@ class Frontend(FileDiffMixin, GitMixin, BaseAgent):
},
)
if await self.is_git_initialized() or await self.init_git_if_needed():
await self.git_commit(commit_msg="Frontend finished")
if self.state_manager.git_available and self.state_manager.git_used:
await self.git_commit(commit_message="Frontend finished")
inputs = []
for file in self.current_state.files:

View File

@@ -89,7 +89,7 @@ class GitMixin:
self.state_manager.git_used = True
return True
async def git_commit(self, commit_msg: Optional[str] = None) -> None:
async def git_commit(self, commit_message: Optional[str] = None) -> None:
"""
Create a git commit with the specified message. Commit message is optional.
Raises RuntimeError if the commit fails.
@@ -133,9 +133,7 @@ class GitMixin:
if status_code != 0:
raise RuntimeError(f"Failed to create initial commit: {stderr}")
if commit_msg:
commit_message = commit_msg
else:
if not commit_message:
llm = self.get_llm()
convo = AgentConvo(self).template(
"commit",