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:
@@ -2818,12 +2818,14 @@
|
||||
console.log(`Error: ${data.stderr}`);
|
||||
}
|
||||
|
||||
// Show terminal notification
|
||||
// Show terminal notification only for manual executions
|
||||
if (!data.is_automated) {
|
||||
if (data.success) {
|
||||
showTerminalNotification('Command completed successfully', 'success');
|
||||
} else {
|
||||
showTerminalNotification('Command execution failed', 'error');
|
||||
}
|
||||
}
|
||||
|
||||
// If viewing execution details, refresh that specific execution
|
||||
const executionModal = document.getElementById('viewExecutionModal');
|
||||
|
||||
@@ -260,7 +260,9 @@ wss.on('connection', (ws) => {
|
||||
|
||||
// For non-workflow executions, update status immediately
|
||||
// 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) {
|
||||
// Only update status for quick commands (no workflow_id)
|
||||
const finalStatus = success ? 'completed' : 'failed';
|
||||
@@ -274,7 +276,8 @@ wss.on('connection', (ws) => {
|
||||
worker_id: worker_id,
|
||||
success: success,
|
||||
stdout: stdout,
|
||||
stderr: stderr
|
||||
stderr: stderr,
|
||||
is_automated: isAutomated,
|
||||
});
|
||||
|
||||
console.log(`Command result received for execution ${execution_id}: ${success ? 'success' : 'failed'}`);
|
||||
|
||||
Reference in New Issue
Block a user