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
Owner

Summary

  • Remove rm -f $msg_file from cmd_delegate
  • The file was being deleted immediately after nohup spawned the background process, but before opencode run could read it
  • This is consistent with cmd_start and cmd_continue which write to $worktree_path/.kugetsu-msg.txt and never delete it

Issue

Fixes #210

## Summary - Remove `rm -f $msg_file` from `cmd_delegate` - The file was being deleted immediately after `nohup` spawned the background process, but before `opencode run` could read it - This is consistent with `cmd_start` and `cmd_continue` which write to `$worktree_path/.kugetsu-msg.txt` and never delete it ## Issue Fixes #210
shoko added 1 commit 2026-04-07 11:52:01 +02:00
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
han approved these changes 2026-04-07 11:53:54 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit 34a0943202 into main 2026-04-07 11:54:24 +02:00
Sign in to join this conversation.