fix(cli): optimize truncateMessage to O(n) and bypass if not TTY#3860
fix(cli): optimize truncateMessage to O(n) and bypass if not TTY#3860rohanranjan0902 wants to merge 1 commit into
Conversation
|
|
Hi @rohanranjan0902, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #3826
✅ Checklist
Testing
truncateMessageusing heavily repeated ANSI strings.!process.stdout.isTTY), it bypasses thetruncateMessagefunction logic entirely to prevent hang in environments whereprocess.stdout.columnsmay be undefined.pnpm run build --filter trigger.devlocally to verify there are no typescript or compilation errors.Changelog
Optimized the
truncateMessagealgorithm in the CLI from O(n²) to O(n) using an ANSI regex. Additionally, bypassed message truncation for non-TTY processes. This resolves an issue wheretrigger deploycould hang indefinitely with 100% CPU usage in CI environments while trying to process large spinner messages.Screenshots
N/A