Skip to content

fix(hermes): enforce trailing newline on patched hermes config - #6085

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/hermes-config-trailing-newline
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/hermes-config-trailing-newline

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/scripts/patch-hermes-config.py, patch_config() conditioned adding a final newline on whether the unpatched original file already possessed one (trailing_newline = original.endswith("\n")). When migrating older template files or user-provided Hermes configs that omitted a terminating newline, the patch utility persisted the missing-newline state. This violated POSIX newline standards and caused YAML parsers and linting tools to flag \ No newline at end of file.

This change unconditionally appends a terminating newline (\n) to serialized YAML configs on write. All section preservation logic, model overrides, provider timeouts, and auxiliary configuration keys remain untouched.

Validation

  • Baseline reproduction: Patching a Hermes configuration file lacking a trailing newline resulted in an output file also lacking a trailing newline.
  • Post-fix verification: Running ods/tests/test_patch_hermes_config_trailing_newline.py validates that patching a config lacking a trailing newline outputs valid YAML ending with \n, applies specified model overrides, and remains idempotent on subsequent runs.
  • Telemetry: Hermes test suite: test_patch_hermes_config_trailing_newline.py passes cleanly (exit code 0). Wired into Linux CI workflow under Hermes Slash Worker Prune Tests.

Overlap check

Risk / AI disclosure

AI-assisted investigation, implementation, and test regressions. This standardizes POSIX trailing newline formatting for patched Hermes YAML files. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.

Follow-up integration evidence

Composed with #6076, #6077, #6078, #6079, #6080, #6081, #6082, #6083, and #6084 at HEAD without conflicts. Production and test diffs passed together; Hermes worker and configuration checks remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants