fix: remove race condition in cmd_delegate msg file deletion #211

Merged
shoko merged 1 commits from fix/issue-210-msg-file-race-condition into main 2026-04-07 11:54:24 +02:00

1 Commits

Author SHA1 Message Date
shokollm
4464e5d91f fix: remove race condition in cmd_delegate msg file deletion
cmd_delegate deletes the message file immediately after spawning the
background nohup process, causing a race condition where opencode run
may not have read the file yet.

Error: File not found: msg-ses_xxx.txt

Fix by removing rm -f "$msg_file", consistent with cmd_start and
cmd_continue which write to $worktree_path/.kugetsu-msg.txt and never
delete it. Orphaned msg files in $LOGS_DIR/ are harmless.

Fixes #210
2026-04-07 09:51:46 +00:00