fix(config): align prefill messages key handling#38760
Merged
kshitijk4poor merged 1 commit intoJun 4, 2026
Merged
Conversation
This was referenced Jun 4, 2026
davidgut1982
pushed a commit
to davidgut1982/hermes-agent
that referenced
this pull request
Jun 5, 2026
…-compat fix(config): align prefill messages key handling
1 task
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.
What does this PR do?
Aligns
prefill_messages_filehandling across Hermes entrypoints.The canonical config key is top-level
prefill_messages_file, as defined in the config schema and already documented by the environment/config docs. Before this PR, the entrypoints disagreed:agent.prefill_messages_fileprefill_messages_fileagent.prefill_messages_fileThat meant the same prefill config could work in one runtime and be silently ignored in another.
This PR makes top-level
prefill_messages_filecanonical while keepingagent.prefill_messages_fileas a legacy read fallback. It also updates godmode to write the canonical key and clears both keys on undo.Related Issue
Fixes #9635.
Supersedes the narrower CLI-only fixes in #9655 and #9872.
Type of Change
Changes Made
cli.py: resolves prefill file paths fromHERMES_PREFILL_MESSAGES_FILE, top-levelprefill_messages_file, then legacyagent.prefill_messages_file.gateway/run.py: accepts legacyagent.prefill_messages_filewhen the canonical top-level key is absent.cron/scheduler.py: accepts legacyagent.prefill_messages_filewhen env/top-level config is absent.skills/red-teaming/godmode/scripts/auto_jailbreak.py: writes canonical top-levelprefill_messages_fileand removes legacy nested prefill state; undo clears both locations.How to Test
prefill_messages_file: prefill.jsonat the config root; CLI, gateway, and cron should all load it.agent.prefill_messages_file: prefill.json; CLI, gateway, and cron should still load it as a fallback.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Local validation:
python -m py_compile cli.py gateway/run.py cron/scheduler.py skills/red-teaming/godmode/scripts/auto_jailbreak.py tests/cli/test_prefill_config.py tests/gateway/test_runtime_config_env_expansion.py tests/cron/test_scheduler.py-> passedgit diff HEAD~1 --check-> passedrg -n -U "agent:\n\s+prefill_messages_file" skills website/docs website/i18n tests -S-> no matchesI did not run pytest locally. This checkout has a standing local restriction against pytest runs; the focused regression tests are included for CI.