You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Vouch request: fix O(n^2) hang in CLI truncateMessage (deploy hangs in CI) #3828
I hit a real bug while using Trigger.dev at work, tracked down the root cause, and would like to contribute the fix back.
trigger deploy hangs at "Deploying project" with a CPU core pegged near 100% in non-TTY CI environments, even though it runs fine locally in ~1 minute. I profiled it with node --prof and found ~92% of the time is spent in truncateMessage() (packages/cli-v3/src/utilities/windows.ts): in a non-TTY shell process.stdout.columns is undefined, so it assumes a width of 80 and truncates large spinner messages one character at a time while re-scanning the whole string with two ANSI regexes on each iteration — O(n^2). A fast machine absorbs it; slower CI runners don't, so the deploy appears to hang.
I reported it in #3826 and already prepared the fix (a single O(n) forward pass that preserves ANSI sequences, plus skipping truncation when there's no terminal width) in #3827, which was auto-closed because I'm not vouched yet. I'd love to get vouched so I can re-open it.
Activity
matt-aitken commentedon Oct 7, 2026
We have a new Vouch policy, please see the discussion here: #5010