From 1d97595607d6938ed43bd2f5805713683a220651 Mon Sep 17 00:00:00 2001 From: I Luk Kim Date: Mon, 13 Apr 2026 10:24:00 -0700 Subject: [PATCH] Fix ran_today: compare phase to 'idle' default instead of bool() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ORBDailyStateRow.phase defaults to 'idle' even when no DB row exists, so bool(daily.phase) was True for brand-new sessions, hiding the 'μ§€κΈˆ μ‹œμž‘' button. Fix: ran_today = phase not in ('idle', '', None). Co-Authored-By: Claude Sonnet 4.6 --- apps/web/routers/orb_trading.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/routers/orb_trading.py b/apps/web/routers/orb_trading.py index 1183bb1..5ac386c 100644 --- a/apps/web/routers/orb_trading.py +++ b/apps/web/routers/orb_trading.py @@ -55,7 +55,9 @@ def list_sessions() -> dict[str, Any]: results = [] for s in sessions: daily = state.get_daily_state(s.session_id, today) - ran_today = bool(daily.phase) # phase is set by engine on first run + # phase starts as "idle" (default); engine sets it to "orb_detection" + # or beyond when it actually runs today + ran_today = daily.phase not in ("idle", "", None) results.append({ "session_id": s.session_id, "session_name": s.session_name,