fix: use spawn for manual cron subprocesses#1767
fix: use spawn for manual cron subprocesses#1767Michaelyklam wants to merge 1 commit intonesquena:masterfrom
Conversation
a8d26b6 to
5ec6888
Compare
|
Thanks @Michaelyklam — this shipped in v0.51.15 (commit A small auto-fix was applied at stage time: 2 of the 5 new tests were failing on dev machines that have an editable hermes_agent install — the spawn child resolves the real GitHub didn't auto-close because the merge commit only references the squash-merged stage branch, not your fork's commit directly — closing manually for hygiene. Live now on existing installs after Release notes: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.15 |
…1767, nesquena#1769, nesquena#1770) Constituent PRs: - nesquena#1762 (@bergeouss) openrouter/ prefix for tencent/hy3-preview:free. Closes nesquena#1744. - nesquena#1767 (@Michaelyklam) use spawn for manual cron subprocesses. Closes nesquena#1754. AUTO-FIX applied: 2 tests skip on dev machines with editable hermes_agent install (the spawn child resolves the real cron.scheduler first instead of the fake one). Tightened detector to use importlib.util.find_spec origin check per Opus stage-309 SHOULD-FIX. - nesquena#1769 (@nesquena-hermes, APPROVED by @nesquena) three context-menu essentials from nesquena#1764: Reveal-in-finder, Copy-path, Open-with-system. - nesquena#1770 (@Michaelyklam) surface Codex usage exhaustion errors. Closes nesquena#1765. Tests: 4662 → 4694 collected (+32). 4687 passed, 4 skipped (2 dev-only + 2 prong-2 noise), 3 xpassed, 0 failed in 135s. Pre-release verification: - All 4 PRs CI-green individually. - node -c clean on all 4 changed JS files. - 11/11 browser API endpoints PASS. - Pre-stamp re-fetch: all PR heads match local rebases. - Opus advisor: SHIP, all 5 verification questions clean, 0 MUST-FIX, 2 SHOULD-FIX (one absorbed: detector tightening; one filed as nesquena#1776 follow-up: custom provider + :free suffix edge case in nesquena#1762). Closes nesquena#1744, nesquena#1754, nesquena#1764, nesquena#1765.
Thinking Path
fork.spawnis the narrow safer process boundary.What Changed
_run_cron_job_in_profile_subprocess()frommultiprocessing.get_context("fork")tomultiprocessing.get_context("spawn").forkvsspawn, demonstrating the ownership model that makesspawnsafe.Fixes #1754
Why It Matters
Verification
env -u HERMES_CONFIG_PATH -u HERMES_WEBUI_HOST /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_issue1574_cron_profile_lock.py tests/test_scheduled_jobs_profile_isolation.py tests/test_issue617_cron_profile_selector.py tests/test_cron_manual_run_persistence.py tests/test_cron_run_job_import.py -q→25 passed in 3.63sgit diff --check→ passedenv -u HERMES_CONFIG_PATH -u HERMES_WEBUI_HOST /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/ -q→4659 passed, 2 skipped, 3 xpassed, 1 warning, 8 subtests passed in 382.22sRisks / Follow-ups
spawnhas a small startup overhead because it starts a fresh Python interpreter; manual cron jobs are long-running enough that this should be negligible.sys.modulesmonkeypatching.Model Used
gpt-5.5via Hermes Agent CLI.