mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
fix(mcp): align OAuth login connect_timeout floor at 315s across CLI and GUI
Raise the CLI login floor from 180s to 315s (OAuth callback window 300s + headroom, matching web_server's existing constant), and let the GUI re-auth path honor a configured connect_timeout larger than 315s.
This commit is contained in:
parent
8a9e30dbd5
commit
f26ae4f683
2 changed files with 13 additions and 4 deletions
|
|
@ -786,14 +786,16 @@ def _reauth_oauth_server(name: str, server_config: dict) -> bool:
|
|||
# Probe triggers the OAuth flow (browser redirect + callback capture).
|
||||
# Honor the server's configured connect_timeout so a human has enough
|
||||
# time to complete the browser sign-in; the 30s default is too tight for
|
||||
# an interactive OAuth round-trip. Give at least 180s for the login path.
|
||||
# an interactive OAuth round-trip. Floor at 315s — the OAuth callback
|
||||
# window (300s in mcp_oauth) plus headroom — matching the GUI re-auth
|
||||
# path in web_server.py so CLI and dashboard behave identically.
|
||||
try:
|
||||
_login_connect_timeout = server_config.get("connect_timeout")
|
||||
try:
|
||||
_login_connect_timeout = float(_login_connect_timeout)
|
||||
except (TypeError, ValueError):
|
||||
_login_connect_timeout = 0.0
|
||||
_login_connect_timeout = max(_login_connect_timeout, 180.0)
|
||||
_login_connect_timeout = max(_login_connect_timeout, 315.0)
|
||||
tools = _probe_single_server(
|
||||
name, server_config, connect_timeout=_login_connect_timeout
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9152,8 +9152,15 @@ async def auth_mcp_server(name: str, profile: Optional[str] = None):
|
|||
# The default 30s connect timeout would kill the flow while the
|
||||
# user is still on the consent screen — give the browser
|
||||
# round-trip the full callback window (300s in mcp_oauth) plus
|
||||
# headroom so the connect wrapper can't pre-empt it.
|
||||
tools = _probe_single_server(name, cfg, connect_timeout=315)
|
||||
# headroom so the connect wrapper can't pre-empt it. Honor a
|
||||
# larger configured connect_timeout when the user set one.
|
||||
try:
|
||||
_cfg_timeout = float(cfg.get("connect_timeout", 0))
|
||||
except (TypeError, ValueError):
|
||||
_cfg_timeout = 0.0
|
||||
tools = _probe_single_server(
|
||||
name, cfg, connect_timeout=max(_cfg_timeout, 315)
|
||||
)
|
||||
except Exception:
|
||||
storage.restore(backup)
|
||||
raise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue