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

@@ -20,6 +20,7 @@ from hf_discovery import HuggingFaceDiscovery, parse_model_card_front_matter #
from official_capabilities import OfficialCapabilityRegistry # noqa: E402
from routing_engine import SuccessFirstRoutingEngine # noqa: E402
from state_sync import StateGitSync # noqa: E402
from state_sync import StateSyncError # noqa: E402
class OfficialClient:
@@ -207,6 +208,19 @@ class SuperAgentTests(unittest.TestCase):
)
)
def test_missing_git_has_actionable_state_sync_error(self) -> None:
with tempfile.TemporaryDirectory() as temporary_dir:
manager = StateGitSync(
project_root=Path(temporary_dir),
credentials={"username": "u", "email": "e@example.com", "password": "p"},
remote="unused",
log_fn=lambda _: None,
)
with patch("state_sync.subprocess.run", side_effect=FileNotFoundError("git")):
with self.assertRaisesRegex(StateSyncError, "rebuild the service image"):
manager._git("version")
manager.close()
def test_config_patch_requires_repeated_cross_model_success(self) -> None:
with tempfile.TemporaryDirectory() as temporary_dir:
root = Path(temporary_dir)