chore: improve logging for "not a git repository" (#7944)

This commit is contained in:
Xingyao Wang
2025-04-21 08:13:48 -04:00
committed by GitHub
parent cd9d96766c
commit a792f84a83
3 changed files with 9 additions and 7 deletions

View File

@@ -202,6 +202,11 @@ async def git_changes(request: Request, conversation_id: str):
try:
changes = await call_sync_from_async(runtime.get_git_changes, cwd)
if changes is None:
return JSONResponse(
status_code=500,
content={'error': 'Not a git repository'},
)
return changes
except AgentRuntimeUnavailableError as e:
logger.error(f'Runtime unavailable: {e}')