Files
hermes-agent/tests
shafdev bd70d7387a fix(agent): lock save_trajectory() appends so concurrent processes cannot corrupt the JSONL
Gateway sessions and batch workers append to the same default
trajectory_samples.jsonl / failed_trajectories.jsonl with a plain open("a") +
write(); concurrent writers interleaved mid-object and the file stopped
parsing (#12684). The append now holds an exclusive lock for write+flush:
flock on POSIX, a 1-byte msvcrt.locking range on Windows.

Tests: a foreign process holding the lock must block the append (red on
base); six processes appending oversized entries all land parseable.

Fixes #12684. Salvaged from #12685 by @shafdev; Windows arm and test trim ours.
2026-09-12 08:25:14 -07:00
..