fix: cron model.default fallback + VIRTUAL_ENV leak into subprocesses (P1 bugs)#45501
Open
Sugumaran-Balasubramaniyan wants to merge 1 commit into
Conversation
fix(cron): make model.default fallback robust against None/empty values
When a cron job has no explicit model override, the scheduler falls back
to config.yaml's model.default. Previously the .get('default', model)
could return an empty string when the default key was absent or None,
passing '' to AIAgent and causing HTTP 400 'Model parameter is required'.
Now the fallback checks for truthiness of the default value before
assigning, preventing empty-model propagation.
Closes NousResearch#43899
fix(terminal): block VIRTUAL_ENV leakage into subprocesses
The gateway and scheduler set VIRTUAL_ENV for their own process
resolution but never scrubbed it from subprocess environments. Package
managers (uv, poetry, pipenv, conda) treat an inherited VIRTUAL_ENV as
an implicit activation marker, potentially reinstalling the Hermes venv
against arbitrary project dependencies and silently destroying the
runtime. Reproduced on v0.16.0 as of 2026-06-12.
Add VIRTUAL_ENV, VIRTUAL_ENV_PROMPT, UV_PROJECT_ENVIRONMENT,
POETRY_ACTIVE, PIPENV_ACTIVE, CONDA_PREFIX, and CONDA_DEFAULT_ENV to
_HERMES_PROVIDER_ENV_BLOCKLIST in tools/environments/local.py.
Closes NousResearch#23473
Contributor
|
Verification: clean review — no issues found. Reviewed the diff (15 additions across
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two P1 bug fixes discovered during systematic review of open issues.
Fix 1: Cron model.default fallback robustness (#43899)
When a cron job has no explicit
modeloverride, the scheduler falls back toconfig.yaml'smodel.default. The previous.get('default', model)could propagate an empty string toAIAgentwhen the default key was absent orNone, causingHTTP 400: Model parameter is required.Fix: Check truthiness of the default value before assigning — ensures empty/None values don't silently replace a valid model.
Fix 2: Block VIRTUAL_ENV leakage into subprocesses (#23473)
The gateway and scheduler set
VIRTUAL_ENVfor their own process resolution but never scrubbed it from subprocess environments. Package managers (uv,poetry,pipenv,conda) treat an inheritedVIRTUAL_ENVas an implicit activation marker, potentially reinstalling the Hermes venv against arbitrary project dependencies — silently destroying the runtime. Still reproduces on v0.16.0 (confirmed 2026-06-12).Fix: Add
VIRTUAL_ENV,VIRTUAL_ENV_PROMPT,UV_PROJECT_ENVIRONMENT,POETRY_ACTIVE,PIPENV_ACTIVE,CONDA_PREFIX, andCONDA_DEFAULT_ENVto_HERMES_PROVIDER_ENV_BLOCKLISTintools/environments/local.py.Note on #13079 (read_file dedup)
Also investigated during this pass — the dedup return at
tools/file_tools.py:835-841already usesstatus: "unchanged"withcontent_returned: falseand the dedup message is in themessagefield (notcontent). The_content_is_dedup_stubguard at line 575-601 provides a write-back safety net. This bug appears to be already resolved in the current codebase and may just need issue closure.Changes
cron/scheduler.pymodel.defaultfallbacktools/environments/local.pyVerification
Closes #43899, closes #23473