Skip to content

Commit 6a92cc7

Browse files
CopilotMte90
andcommitted
Fix test case and deprecation warning in IndexSyncAgent
Co-authored-by: Mte90 <403283+Mte90@users.noreply.github.com>
1 parent b0c147d commit 6a92cc7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ai/agents/index_sync_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import threading
1010
import time
11-
from datetime import datetime
11+
from datetime import datetime, timezone
1212
from typing import Any, Dict, List, Optional, Callable
1313
import os
1414

@@ -230,7 +230,7 @@ def _reconcile_project(self, project: Dict[str, Any]) -> None:
230230

231231
metadata = {}
232232
if actual_status == "ready":
233-
metadata["last_indexed_at"] = datetime.utcnow().isoformat()
233+
metadata["last_indexed_at"] = datetime.now(timezone.utc).isoformat()
234234

235235
self._update_project_status(
236236
project_id,

tests/test_index_sync_agent.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ def test_agent_reconcile_indexed_project(self):
139139
"""Test reconciliation of fully indexed project."""
140140
db_path = os.path.join(self.temp_dir, "indexed.db")
141141

142+
# Create a dummy database file so it "exists"
143+
open(db_path, 'w').close()
144+
142145
self.mock_db.projects = [{
143146
"id": "test456",
144147
"path": self.temp_dir,

0 commit comments

Comments
 (0)