You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In skills/continuous-learning-v2/hooks/observe.sh around lines 485-495, the SIGUSR1 throttle counter uses a plain file read-modify-write pattern with no locking. When multiple hook invocations fire concurrently (which is common since tool calls can fire every second), they can read the same counter value, both increment it, and write back — losing increments and potentially signaling the observer more or less frequently than intended.
Use an atomic approach such as flock around the read-modify-write, or use mkdir as a lockfile primitive, or use an append-based counter (count lines in the file rather than read/modify/write a single value).
Summary
In
skills/continuous-learning-v2/hooks/observe.sharound lines 485-495, the SIGUSR1 throttle counter uses a plain file read-modify-write pattern with no locking. When multiple hook invocations fire concurrently (which is common since tool calls can fire every second), they can read the same counter value, both increment it, and write back — losing increments and potentially signaling the observer more or less frequently than intended.Relevant code
Impact
>= 20, and both signal — defeating the throttleSuggested fix
Use an atomic approach such as
flockaround the read-modify-write, or usemkdiras a lockfile primitive, or use an append-based counter (count lines in the file rather than read/modify/write a single value).