Skip to content

fix(cli): O(n) truncateMessage and skip truncation when non-TTY#4299

Closed
ANSHSINGH050404 wants to merge 1 commit into
triggerdotdev:mainfrom
ANSHSINGH050404:fix/cli-truncate-message-perf
Closed

fix(cli): O(n) truncateMessage and skip truncation when non-TTY#4299
ANSHSINGH050404 wants to merge 1 commit into
triggerdotdev:mainfrom
ANSHSINGH050404:fix/cli-truncate-message-perf

Conversation

@ANSHSINGH050404

Copy link
Copy Markdown

Closes #3826

Checklist

  • Followed CONTRIBUTING.md
  • Single issue PR
  • Changeset / server-changes when required

Summary

Character-by-character truncation was O(n²) and ran in non-TTY CI, hanging large deploys.

Fix

Skip truncation when not a TTY; otherwise truncate in a single pass.

Vouch request: #4290

@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4ba3d8b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 26 packages
Name Type
trigger.dev Patch
@internal/dashboard-agent Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/python Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@trigger.dev/rbac Patch
@trigger.dev/sso Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/run-store Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/sdk-compat-tests Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Hi @ANSHSINGH050404, 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.

@github-actions github-actions Bot closed this Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b93965c8-6f84-4d96-92f8-c5d694713167

📥 Commits

Reviewing files that changed from the base of the PR and between a7c734c and 4ba3d8b.

📒 Files selected for processing (2)
  • .changeset/cli-truncate-message-perf.md
  • packages/cli-v3/src/utilities/windows.ts

Walkthrough

Updated CLI spinner message truncation to return unmodified messages in non-TTY environments when no explicit limit is provided. Replaced repeated recalculation with a single-pass scan that preserves ANSI hyperlinks and CSI sequences while enforcing visible-length limits. Added a patch Changesets entry documenting these behavior and performance changes.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: CLI deploy hangs (100% CPU) in non-TTY CI — truncateMessage() is O(n²)

1 participant