nextcloud / assistant

✨ Nextcloud Assistant
GNU Affero General Public License v3.0
23 stars 4 forks source link

Nextcloud assistant is sending email notifications for all jobs despite email notifications being disabled #11

Open alraban opened 11 months ago

alraban commented 11 months ago

Which version of assistant are you using?

1.01

Which version of Nextcloud are you using?

27.1.2

Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.

Firefox 118.0.1

Describe the Bug

I am using nextcloud assistant in combination with the nextcloud local llm package. https://github.com/nextcloud/llm/tree/main

Whenever I send a job via the assistant, the job is scheduled and typically executed successfully. When the job completes, I receive a helpful push notification as expected, but in addition to push notifications, nextcloud assistant attempts to send an email to the local webuser (www-data in my case) that only contains the text "Task successful 9" where the number is the job id. To be clear, the email does not contain the prompt or any results from the LLM, it's purely a notice that the job ran successfully (or not).

This is undesired behavior as I have disabled email notifications in the nextcloud notification settings. I do forward all local system mail to my personal email so that I can review server issues, and receiving a system email after every single assistant task executes is extremely unpleasant on a busy server.

Looking at the code, I suspect the issue might be that the TaskSuccessfulListener is logging successful completion to the error log rather than stdout, but am not certain that's the issue.

Additionally, I'm not sure it's relevant, but the following error immediately precedes the email transmission of successful completion in the logs: T11:10:25-04:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Undefined variable $notificationActionLabel at /var/www/nextcloud/apps/assistant/lib/Listener/TaskSuccessfulListener.php#46

Expected Behavior

I expect nextcloud apps to respect the nextcloud notification settings (i.e. send no emails at all when I have not enabled email notifications via the nextcloud UI). Additionally, I would expect a server program to simply log successful job completion rather than emailing about every single job.

If this is intended behavior, please provide a way to disable nextcloud assistant from sending emails at all.

To Reproduce

Run any query with Assistant and the local LLM. Wait for it to complete. Then check your local system email, and you should have an email with the body text "Task successful [job id]"