Repository navigation
fix(hermes): write SOUL.md atomically and guard missing template in build-installation-context.py - #6324
Closed
vaibhavsrv wants to merge 1 commit into
Closed
fix(hermes): write SOUL.md atomically and guard missing template in build-installation-context.py#6324vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
…uild-installation-context.py
Collaborator
|
Thanks for this contribution. |
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.
Why this matters
In
ods/scripts/build-installation-context.py,render_installation_context()assembles the runtime persona filedata/persona/SOUL.mdby directly callingoutput_path.write_text(...)on the live path. BecauseSOUL.mdis bind-mounted directly into the runningods-hermescontainer and inspected on new chat sessions, non-atomic writes expose a window where Hermes reads an empty or truncated persona file during installer runs or service restarts. Additionally, if the template path is missing or invalid, the function encounters an unhandledFileNotFoundErrorwithout contextual path information.This patch adds a file verification guard on
template_pathand writes the assembled persona content to a peer.tmpfile before performing an atomic rename viaos.replace(). Existing persona assembly logic, marker replacement rules, and compact profiles remain untouched.Validation
output_pathexposed non-atomic write windows to concurrent container reads, and missing templates threw bare uncaught exceptions.render_installation_context()creates a temporary sibling file and atomically replacesdata/persona/SOUL.md, verifying file integrity across concurrent reads.Overlap check
fix(amd-topo): guard non-numeric byte counts in amd_memory_type) — GPU topology script classification; no persona template overlap.fix(pixel-inference): validate top_logprobs integer bounds) — API inference argument bounds; separate subsystem.fix(hermes): enforce trailing newline on patched hermes config) — Hermes YAML config formatting, distinct from SOUL.md dynamic generation.Risk / AI disclosure
Follow-up integration evidence