fix: install git for durable state recovery

This commit is contained in:
CoolBoy
2026-08-15 19:33:07 +08:00
parent 4260793c03
commit 467eaccd59
5 changed files with 41 additions and 15 deletions

View File

@@ -222,16 +222,23 @@ class StateGitSync:
return env
def _git(self, *args: str, cwd: Path | None = None, check: bool = True) -> subprocess.CompletedProcess[str]:
result = subprocess.run(
["git", *args],
cwd=str(cwd or self.project_root),
env=self._git_environment(),
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
timeout=45,
check=False,
)
try:
result = subprocess.run(
["git", *args],
cwd=str(cwd or self.project_root),
env=self._git_environment(),
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
timeout=45,
check=False,
)
except FileNotFoundError as exc:
raise StateSyncError(
"git executable is unavailable; rebuild the service image from the repository Dockerfile"
) from exc
except subprocess.TimeoutExpired as exc:
raise StateSyncError("git operation timed out after 45 seconds") from exc
if check and result.returncode != 0:
reason = _safe_text(result.stderr.strip() or result.stdout.strip() or f"git exited {result.returncode}")
raise StateSyncError(reason)

View File

@@ -1 +1 @@
AGENT_VERSION = "2026.08.15.1"
AGENT_VERSION = "2026.08.15.2"