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
{{ message }}
Repository navigation
developer-profile: concurrent background --derive runs share one temp file #3437
Follow-up from the /ship review of #3397 (pre-existing; #3397 does not change it).
gstack-question-log starts a background gstack-developer-profile --derive after every append (output to /dev/null), and the PostToolUse hook logs once per question in a multi-question AskUserQuestion, so several derives can run at once. Each one writes the same fixed temp path (developer-profile.json.tmp beside the profile) and does an unlocked read-modify-write of the whole profile.
Effects:
one derive's rename can fail with ENOENT, swallowed in the background;
overlapping writes can leave torn JSON that gets renamed into place, after which every later derive fails at JSON.parse;
a derive can overwrite a concurrent --log-session write and drop that session.
Suggested fix: a unique temp name (pid plus random) and a lock, or a re-read just before the rename.
Fixed in #3738 (merged as 7762c39, v1.92.69.0). --derive, --log-session, --reconcile and --migrate now hold developer-profile.json.lock across read-modify-rename and each writes its own mktemp file. On main before the fix, 9 of 270 overlapping derives failed with ENOENT and 2 of 30 sessions were lost; after it, 0 of 270 and 30 of 30 kept. Still unlocked: gstack-distill-apply and /plan-tune's declared edits (noted in the changelog fragment).
Activity
v1.92.69.0 fix: lock developer-profile writers so overlapping derives…
capy-ai commentedon Nov 2, 2026
Fixed in #3738 (merged as 7762c39, v1.92.69.0).
--derive,--log-session,--reconcileand--migratenow holddeveloper-profile.json.lockacross read-modify-rename and each writes its own mktemp file. On main before the fix, 9 of 270 overlapping derives failed with ENOENT and 2 of 30 sessions were lost; after it, 0 of 270 and 30 of 30 kept. Still unlocked:gstack-distill-applyand /plan-tune's declared edits (noted in the changelog fragment).