Skip to content

fix(cli): preserve legacy root prefill_messages_file support#9872

Closed
ErickAgrazal wants to merge 1 commit into
NousResearch:mainfrom
ErickAgrazal:fix/issue-9635-prefill-messages-file
Closed

fix(cli): preserve legacy root prefill_messages_file support#9872
ErickAgrazal wants to merge 1 commit into
NousResearch:mainfrom
ErickAgrazal:fix/issue-9635-prefill-messages-file

Conversation

@ErickAgrazal

Copy link
Copy Markdown

Summary

  • map legacy root-level prefill_messages_file into agent.prefill_messages_file during CLI config loading
  • keep nested agent.prefill_messages_file authoritative when both keys are present
  • add regression coverage for both the legacy fallback and nested-key precedence

Test Plan

  • python -m pytest tests/cli/test_cli_init.py::TestRootLevelPrefillMessagesFile -q
  • python -m pytest tests/cli/test_cli_init.py -q
  • manual repro: load config with only root-level prefill_messages_file and verify CLI config exposes the same value under agent.prefill_messages_file

Notes

  • This keeps CLI behavior aligned with gateway and cron without changing the canonical config schema in this PR.
  • I did not run python -m pytest tests/ -q because upstream main is currently red in this environment on many unrelated failures; I validated the directly affected CLI test surface instead.

Closes #9635

@nidhishgajjar

Copy link
Copy Markdown

Orb Code Review (powered by GLM 5.1 on Orb Cloud)

PR #9872 — fix(cli): preserve legacy root prefill_messages_file support

Summary of Changes

This PR adds backward compatibility for the root-level prefill_messages_file config key by copying it into the agent.prefill_messages_file section when the nested key is absent. This matches the pattern already used for other legacy root-level keys like model and max_turns.

Review

Correctness

  • The precedence logic is correct: an explicit agent.prefill_messages_file takes priority over the legacy root key. This matches the established pattern in the same function.
  • The guard condition properly checks isinstance(agent_file_config, dict) before calling .get(), avoiding potential AttributeError on non-dict values.

Testing

  • Two well-structured test cases cover the happy path (root key copied) and the precedence path (nested key wins). These are the exact scenarios that matter.

Readability

  • The inline comment clearly explains the intent and rationale.
  • The code is minimal and follows the existing pattern in the same block (see the max_turns handling above).

Summary

Clean backward-compatibility fix that follows the established pattern in load_cli_config. Tests cover both code paths.

Assessment: approve

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Apr 26, 2026
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Superseded by #38760, which merged the broader fix: top-level prefill_messages_file is now canonical across cli/gateway/cron with agent.prefill_messages_file retained as a legacy fallback. Closing as completed since the underlying issue (#9635) is now fixed on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI ignores root-level prefill_messages_file from config.yaml

4 participants