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
This commit is contained in:
@@ -228,7 +228,6 @@ cmd_delegate() {
|
||||
local msg_file="$LOGS_DIR/msg-$new_session.txt"
|
||||
printf '%s' "$message" > "$msg_file"
|
||||
nohup sh -c "GITEA_TOKEN='${GITEA_TOKEN:-}' opencode run '@$msg_file' --session '$new_session'" >> "$log_file" 2>&1 &
|
||||
rm -f "$msg_file"
|
||||
echo "Delegated to new session (logged to $(basename "$log_file"))"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user