Laravel AI SDK Silently Kills Your Horizon Queue (And How to Fix It in 4 Config Changes)
The Laravel AI SDK can cause issues with the Horizon queue system, leading to silent job failures. This occurs because the default configuration is not suited for longer-running AI tasks, which can take significantly more time than the default timeout settings. Developers can resolve these issues by adjusting four specific configuration values to better accommodate the duration of AI jobs.
- ▪The default Horizon configuration assumes jobs are completed quickly, typically within seconds.
- ▪AI SDK jobs can take 30 to 120 seconds, leading to silent failures when they exceed the default timeout.
- ▪Developers are advised to change the supervisor timeout and other settings to prevent job failures and duplicate processing.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 1284090) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Hafiz Posted on May 27 • Originally published at hafiz.dev Laravel AI SDK Silently Kills Your Horizon Queue (And How to Fix It in 4 Config Changes) #laravel #laravelhorizon #queues #laravelaisdk Originally published at hafiz.dev Your Horizon was healthy. Email jobs, notifications, small processing tasks, all running fine with zero issues. You added the AI SDK, wrapped a few agent calls in background jobs, and deployed to production.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).