From 2d6855483d371795af63d8b803c12939885efbcf Mon Sep 17 00:00:00 2001 From: Matt Van Horn Date: Sun, 15 Feb 2026 00:57:32 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20Reddit=20future=20timeout=20=E2=80=94=20?= =?UTF-8?q?same=20bug=20as=20YouTube?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenAI Responses API web_search takes 60-90s but the generic future timeout was killing it at 30s (quick) / 60s (default). Added reddit_future key to TIMEOUT_PROFILES (60/90/120s). Co-Authored-By: Claude Opus 4.6 --- scripts/last30days.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/last30days.py b/scripts/last30days.py index 4856202..799965a 100644 --- a/scripts/last30days.py +++ b/scripts/last30days.py @@ -38,9 +38,9 @@ _child_pids: set = set() _child_pids_lock = threading.Lock() TIMEOUT_PROFILES = { - "quick": {"global": 90, "future": 30, "youtube_future": 60, "http": 15, "enrich_per": 8, "enrich_total": 30, "enrich_max_items": 10}, - "default": {"global": 180, "future": 60, "youtube_future": 90, "http": 30, "enrich_per": 15, "enrich_total": 45, "enrich_max_items": 15}, - "deep": {"global": 300, "future": 90, "youtube_future": 120, "http": 30, "enrich_per": 15, "enrich_total": 60, "enrich_max_items": 25}, + "quick": {"global": 90, "future": 30, "reddit_future": 60, "youtube_future": 60, "http": 15, "enrich_per": 8, "enrich_total": 30, "enrich_max_items": 10}, + "default": {"global": 180, "future": 60, "reddit_future": 90, "youtube_future": 90, "http": 30, "enrich_per": 15, "enrich_total": 45, "enrich_max_items": 15}, + "deep": {"global": 300, "future": 90, "reddit_future": 120, "youtube_future": 120, "http": 30, "enrich_per": 15, "enrich_total": 60, "enrich_max_items": 25}, } @@ -612,12 +612,13 @@ def run_research( # Collect results (with timeouts to prevent indefinite blocking) if reddit_future: + reddit_timeout = timeouts.get("reddit_future", future_timeout) try: - reddit_items, raw_openai, reddit_error = reddit_future.result(timeout=future_timeout) + reddit_items, raw_openai, reddit_error = reddit_future.result(timeout=reddit_timeout) if reddit_error and progress: progress.show_error(f"Reddit error: {reddit_error}") except TimeoutError: - reddit_error = f"Reddit search timed out after {future_timeout}s" + reddit_error = f"Reddit search timed out after {reddit_timeout}s" if progress: progress.show_error(reddit_error) except Exception as e: