feat(error-handling): add claudesync recovery logic

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-04-12 23:13:08 -07:00
parent fa4d7adc98
commit b93c3aca2d

View file

@ -677,10 +677,27 @@ class CommitDaemon:
f"commit(s) from remote"
)
elif sync_result["error"]:
error = sync_result["error"]
logger.warning(
f"[{cycle_id}] {repo.name}: Pre-cycle sync issue: "
f"{sync_result['error']} (continuing anyway)"
f"[{cycle_id}] {repo.name}: Pre-cycle sync issue: {error}"
)
# Let Claude handle sync failures (conflicts, pull issues)
if self.error_handler and error != "fetch_failed":
logger.info(
f"[{cycle_id}] {repo.name}: Invoking Claude to resolve sync issue"
)
recovery = await self.error_handler.handle(
repo, f"Pre-cycle sync failed: {error}"
)
if recovery.success:
logger.info(
f"[{cycle_id}] {repo.name}: Claude resolved sync issue"
)
else:
logger.warning(
f"[{cycle_id}] {repo.name}: Claude could not resolve sync: "
f"{recovery.error} (continuing anyway)"
)
except Exception as e:
logger.warning(
f"[{cycle_id}] {repo.name}: Pre-cycle sync failed: {e} "