From 50885cd5a010780e43a14e8acaf81d490f206d3a Mon Sep 17 00:00:00 2001 From: Priyanka Punukollu Date: Thu, 26 Feb 2026 18:02:48 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20resolve=20Railway=20deployment=20crash?= =?UTF-8?q?=20=E2=80=94=20wealth=5Fbridge.py=20used=20agent.tools=20absolu?= =?UTF-8?q?te=20imports=20that=20fail=20without=20PYTHONPATH;=20add=20sys.?= =?UTF-8?q?path=20fallback=20pattern=20to=20work=20in=20both=20local=20and?= =?UTF-8?q?=20Railway=20environments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- main.py | 2 +- requirements.txt | 2 ++ tools/wealth_bridge.py | 32 +++++++++++++++++++++++++------- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index e65f0dc9b..082cb6d69 100644 --- a/main.py +++ b/main.py @@ -592,7 +592,7 @@ async def health(): "status": "ok", "ghostfolio_reachable": ghostfolio_ok, "timestamp": datetime.utcnow().isoformat(), - "version": "2.0.0-complete-showcase", + "version": "2.1.0-complete-showcase", "features": ["relocation_runway", "wealth_gap", "life_decision", "equity_unlock", "family_planner"], } diff --git a/requirements.txt b/requirements.txt index 9b0d5e072..bab75f770 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,3 +8,5 @@ httpx python-dotenv pytest pytest-asyncio + +# cache-bust-1772149708 diff --git a/tools/wealth_bridge.py b/tools/wealth_bridge.py index 313c8fd35..51bc20e8f 100644 --- a/tools/wealth_bridge.py +++ b/tools/wealth_bridge.py @@ -21,14 +21,29 @@ Mortgage assumption: 30-year fixed at 6.95%, 20% down, payment × 1.25 """ import asyncio +import sys +import os from typing import Optional -from agent.tools.real_estate import _MOCK_SNAPSHOTS, _normalize_city -from agent.tools.teleport_api import ( - HARDCODED_FALLBACK, - _is_austin_area, - get_city_housing_data, -) +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + +try: + from real_estate import _MOCK_SNAPSHOTS, _normalize_city +except ImportError: + from agent.tools.real_estate import _MOCK_SNAPSHOTS, _normalize_city + +try: + from teleport_api import ( + HARDCODED_FALLBACK, + _is_austin_area, + get_city_housing_data, + ) +except ImportError: + from agent.tools.teleport_api import ( + HARDCODED_FALLBACK, + _is_austin_area, + get_city_housing_data, + ) # --------------------------------------------------------------------------- # COL index values for Austin TX sub-markets (ACTRIS coverage areas) @@ -468,7 +483,10 @@ async def get_portfolio_real_estate_summary( Returns: Combined dict with portfolio_summary, down_payment_analysis, quick_answer. """ - from agent.tools.portfolio import portfolio_analysis + try: + from portfolio import portfolio_analysis + except ImportError: + from agent.tools.portfolio import portfolio_analysis portfolio_result = await portfolio_analysis()