mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 02:05:22 -04:00
Research: add configurable run timeout
Surfaces the research_run_timeout_seconds setting (added in #783) in Settings → Research as a "Max Time" field, and lets 0 disable the wall-clock cap entirely for long deep-research runs. - settings.py: document that 0 disables the cap; default stays 1800s. - research_handler.py: resolve 0 (or negative) to no timeout (asyncio.wait_for timeout=None); other values stay bounded to [60, 86400] as before. - index.html / settings.js: "Max Time" input bound to research_run_timeout_seconds, validated to {0} ∪ [60, 86400], with copy making explicit that 0 = no limit (unbounded model/API cost). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+17
-7
@@ -216,15 +216,25 @@ class ResearchHandler:
|
||||
"""
|
||||
# Resolve the hard wall-clock timeout from settings when the caller
|
||||
# didn't pin one. Local / edge models routinely need more than the
|
||||
# old 600s default to finish a deep-research synthesis.
|
||||
# old 600s default to finish a deep-research synthesis. A setting of
|
||||
# 0 disables the cap entirely (unlimited run); any other value is
|
||||
# bounded to [60, 86400] so a misconfigured settings.json can't
|
||||
# explode into a multi-day hang.
|
||||
if hard_timeout is None:
|
||||
from src.settings import get_setting
|
||||
hard_timeout = _bounded_int(
|
||||
get_setting("research_run_timeout_seconds", 1800),
|
||||
default=1800,
|
||||
minimum=60,
|
||||
maximum=86400,
|
||||
)
|
||||
try:
|
||||
raw_timeout = int(get_setting("research_run_timeout_seconds", 1800))
|
||||
except (TypeError, ValueError):
|
||||
raw_timeout = 1800
|
||||
if raw_timeout <= 0:
|
||||
hard_timeout = None # 0 = no wall-clock cap (asyncio.wait_for timeout=None)
|
||||
else:
|
||||
hard_timeout = _bounded_int(
|
||||
raw_timeout,
|
||||
default=1800,
|
||||
minimum=60,
|
||||
maximum=86400,
|
||||
)
|
||||
|
||||
# Cancel any existing research for this session
|
||||
if session_id in self._active_tasks:
|
||||
|
||||
+4
-1
@@ -89,7 +89,10 @@ DEFAULT_SETTINGS = {
|
||||
# Hard wall-clock cap on a single deep-research run. The previous 600s
|
||||
# (10 min) default cut off slow local / edge LLMs mid-synthesis; 1800s
|
||||
# (30 min) is comfortable for most local setups while still bounding
|
||||
# runaway jobs. Tune via Settings or by editing data/settings.json.
|
||||
# runaway jobs. Set to 0 to disable the cap entirely (unlimited) — only
|
||||
# for very long deep-research runs, since a stalled job then runs an
|
||||
# unbounded model/API bill. Other values are bounded to [60, 86400].
|
||||
# Tune via Settings or by editing data/settings.json.
|
||||
"research_run_timeout_seconds": 1800,
|
||||
"agent_max_tool_calls": 0,
|
||||
"agent_input_token_budget": 6000,
|
||||
|
||||
Reference in New Issue
Block a user