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,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
|
||||||
|
|||||||
@@ -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'}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user