Skip to content

Make skill file writes atomic#551

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
aydnOktay:feature/atomic-skill-writes
Mar 10, 2026
Merged

Make skill file writes atomic#551
teknium1 merged 1 commit into
NousResearch:mainfrom
aydnOktay:feature/atomic-skill-writes

Conversation

@aydnOktay
Copy link
Copy Markdown
Contributor

his PR hardens skill management operations by making all file writes atomic. The skill_manager_tool now uses a temporary file and os.replace() for writing SKILL.md and supporting files, preventing corruption if Hermes crashes or is interrupted mid-write. The change adds a _atomic_write_text() helper that handles temp file creation, content writing, and atomic replacement, and updates _create_skill, _edit_skill, _patch_skill, and _write_file to use it. Rollback operations during security scans are also atomic, ensuring skill files remain consistent even if errors occur

@teknium1 teknium1 merged commit 739eb67 into NousResearch:main Mar 10, 2026
1 check passed
@teknium1
Copy link
Copy Markdown
Contributor

Merged locally with contributor credit (739eb67). Clean, well-implemented atomic write pattern — thanks for the contribution! 🙏

angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
Authored by aydnOktay. Adds _atomic_write_text() helper using tempfile.mkstemp()
+ os.replace() to prevent skill file corruption on crash/interrupt. All 7
write_text() calls in skill_manager_tool.py converted, including rollback writes
during security scans.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Authored by aydnOktay. Adds _atomic_write_text() helper using tempfile.mkstemp()
+ os.replace() to prevent skill file corruption on crash/interrupt. All 7
write_text() calls in skill_manager_tool.py converted, including rollback writes
during security scans.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
Authored by aydnOktay. Adds _atomic_write_text() helper using tempfile.mkstemp()
+ os.replace() to prevent skill file corruption on crash/interrupt. All 7
write_text() calls in skill_manager_tool.py converted, including rollback writes
during security scans.
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