hermes-bsd/scripts
qdaszx 6305ac0e4b fix(mcp): run OSV malware preflight off the event loop with a bounded timeout (#29184)
During stdio MCP server startup, _run_stdio (an async method) called the
synchronous check_package_for_malware() inline. That makes a blocking
urllib HTTPS POST to api.osv.dev whose own timeout doesn't reliably cover a
stalled SSL handshake, so an intermittent network issue froze the entire
asyncio event loop for up to ~120s — blowing past the TUI/gateway's 15s
startup budget and showing "gateway startup timeout".

Run the check via asyncio.to_thread (off the loop) AND bound it with
asyncio.wait_for(timeout=_OSV_MALWARE_CHECK_TIMEOUT_S=12s). The malware check
is fail-open, so on timeout we log and proceed rather than blocking startup.

Salvaged from #29190 by @qdaszx (re-applied on current main — the call site
moved since the PR was opened), combining the to_thread approach also proposed
in #29192 by @ygd58. Two load-bearing tests: event-loop-not-blocked-during-
check and timeout-fails-open — both mutation-verified to fail against the old
inline blocking call.

Closes #29184.

Co-authored-by: ygd58 <buraysandro9@gmail.com>
2026-06-25 23:30:41 +05:30
..
ci fix(ci): only run supplychain checks in pr 2026-06-23 09:46:25 -07:00
lib fix(install): repair existing managed-Node global prefix on re-run 2026-06-14 17:34:11 +07:00
tests test(install): add ConvertTo-LongPath helper for 8.3 short paths 2026-06-20 16:24:52 -07:00
whatsapp-bridge fix(whatsapp): restart stale bridge processes instead of silently reusing them (#44205) 2026-06-11 03:47:29 -07:00
analyze_livetest.py
benchmark_browser_eval.py
build_model_catalog.py
build_skills_index.py fix(skills): let ClawHub index build walk past the 12s browse budget (#44500) 2026-06-11 18:03:11 -04:00
check-windows-footguns.py
check_subprocess_stdin.py
contributor_audit.py
discord-voice-doctor.py
docker_config_migrate.py fix(docker): restore config backups after failed boot migration 2026-06-24 15:23:23 +10:00
hermes-gateway
install.cmd
install.ps1 fix(install): harden venv-resident process sweep on Windows 2026-06-24 13:25:44 -04:00
install.sh fix(install): drop system-browser fallback + auto-repair stale snap override 2026-06-23 10:38:15 -07:00
install_psutil_android.py
keystroke_diagnostic.py
kill_modal.sh
lint_diff.py
LIVETEST_README.md
profile-tui.py
release.py fix(mcp): run OSV malware preflight off the event loop with a bounded timeout (#29184) 2026-06-25 23:30:41 +05:30
run_tests.sh fix(ci): remove pytest-timeout, use per-file timeout only 2026-06-12 13:42:42 -04:00
run_tests_parallel.py fix(tests): remove no-longer-needed forensics 2026-06-12 13:42:42 -04:00
sample_and_compress.py
setup_open_webui.sh
tool_search_livetest.py