From 9147144841d7013b4dc64039a9eb2225218a6b57 Mon Sep 17 00:00:00 2001 From: Priyanka Punukollu Date: Thu, 26 Feb 2026 17:01:13 -0600 Subject: [PATCH] fix: equity advisor uses shared db connection for test isolation Made-with: Cursor --- agent/tools/property_tracker.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/agent/tools/property_tracker.py b/agent/tools/property_tracker.py index 42a4ac49b..56fb03525 100644 --- a/agent/tools/property_tracker.py +++ b/agent/tools/property_tracker.py @@ -648,20 +648,15 @@ def analyze_equity_options( """Analyzes 3 options for home equity: leave untouched, cash-out refi and invest, or use for rental property.""" - db_path = os.path.join( - os.path.dirname(__file__), '..', 'data', 'properties.db' - ) - try: - conn = sqlite3.connect(db_path) - conn.row_factory = sqlite3.Row + conn = _get_conn() cur = conn.cursor() cur.execute( "SELECT * FROM properties WHERE id=? AND is_active=1", (property_id,), ) row = cur.fetchone() - conn.close() + _close_conn(conn) except Exception as e: return { "error": f"Database error: {str(e)}",