Suppress toast notifications for automated executions

Automated executions (started_by gandalf: or scheduler:) no longer
trigger success/failure toast alerts for connected browser users.
Server now includes is_automated flag in command_result broadcasts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 16:26:18 -05:00
parent 937bddbe2f
commit 0fee118d1d
2 changed files with 12 additions and 7 deletions

View File

@@ -2818,11 +2818,13 @@
console.log(`Error: ${data.stderr}`); console.log(`Error: ${data.stderr}`);
} }
// Show terminal notification // Show terminal notification only for manual executions
if (data.success) { if (!data.is_automated) {
showTerminalNotification('Command completed successfully', 'success'); if (data.success) {
} else { showTerminalNotification('Command completed successfully', 'success');
showTerminalNotification('Command execution failed', 'error'); } else {
showTerminalNotification('Command execution failed', 'error');
}
} }
// If viewing execution details, refresh that specific execution // If viewing execution details, refresh that specific execution

View File

@@ -260,7 +260,9 @@ wss.on('connection', (ws) => {
// For non-workflow executions, update status immediately // For non-workflow executions, update status immediately
// For workflow executions, the workflow engine will update status // For workflow executions, the workflow engine will update status
const [execution] = await pool.query('SELECT workflow_id FROM executions WHERE id = ?', [execution_id]); const [execution] = await pool.query('SELECT workflow_id, started_by FROM executions WHERE id = ?', [execution_id]);
const startedBy = execution.length > 0 ? (execution[0].started_by || '') : '';
const isAutomated = startedBy.startsWith('gandalf:') || startedBy.startsWith('scheduler:');
if (execution.length > 0 && !execution[0].workflow_id) { if (execution.length > 0 && !execution[0].workflow_id) {
// Only update status for quick commands (no workflow_id) // Only update status for quick commands (no workflow_id)
const finalStatus = success ? 'completed' : 'failed'; const finalStatus = success ? 'completed' : 'failed';
@@ -274,7 +276,8 @@ wss.on('connection', (ws) => {
worker_id: worker_id, worker_id: worker_id,
success: success, success: success,
stdout: stdout, stdout: stdout,
stderr: stderr stderr: stderr,
is_automated: isAutomated,
}); });
console.log(`Command result received for execution ${execution_id}: ${success ? 'success' : 'failed'}`); console.log(`Command result received for execution ${execution_id}: ${success ? 'success' : 'failed'}`);