Skip to content

fix(env): concurrent .env writes cause token clobbering - #77534

Open
eaglezzz0522-cloud wants to merge 1 commit into
NousResearch:mainfrom
eaglezzz0522-cloud:fix/77187-env-concurrent-writes
Open

fix(env): concurrent .env writes cause token clobbering#77534
eaglezzz0522-cloud wants to merge 1 commit into
NousResearch:mainfrom
eaglezzz0522-cloud:fix/77187-env-concurrent-writes

Conversation

@eaglezzz0522-cloud

Copy link
Copy Markdown

Summary

Add portalocker.Lock(env_path, timeout=5, fail_when_locked=False) in save_env_value() and remove_env_value() covering the full read-modify-write path on ~/.hermes/.env.

portalocker is already a transitive dependency (used by uv in the venv).

Related

Closes #77187

Validation

  • Python syntax check passed
  • Clean rebase on current main (fe6330d)

Add portalocker.Lock(env_path, timeout=5, fail_when_locked=False) in
save_env_value() and remove_env_value() covering the full read-modify-write
path on ~/.hermes/.env.

portalocker is already a transitive dependency.

Closes NousResearch#77187
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades needs-decision Awaiting maintainer decision before any implementation labels Aug 3, 2026
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 needs-decision Awaiting maintainer decision before any implementation P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(config): concurrent .env writes lose updates silently (RAH-02)

2 participants