Skip to content

fix(task): dont truncate task message when CI is set#6620

Merged
jdx merged 1 commit intojdx:mainfrom
roele:issues/6618
Oct 9, 2025
Merged

fix(task): dont truncate task message when CI is set#6620
jdx merged 1 commit intojdx:mainfrom
roele:issues/6618

Conversation

@roele
Copy link
Copy Markdown
Contributor

@roele roele commented Oct 9, 2025

Skip truncation of task message if CI is set as mentioned in #6618

Copilot AI review requested due to automatic review settings October 9, 2025 20:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes task message truncation in CI environments by bypassing the truncation logic when the CI environment variable is set.

  • Modified the trunc function to return the full message without truncation when CI mode is detected
  • Added test coverage to verify that task output is not truncated with ellipsis when CI environment variable is set

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/cli/run.rs Added CI check to bypass message truncation in the trunc function
e2e/tasks/test_task_display_truncation Added test case to verify no truncation occurs in CI mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/cli/run.rs Outdated
Comment thread src/cli/run.rs

fn trunc(prefix: &str, msg: &str) -> String {
if Settings::get().ci {
return msg.to_string();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

hmm I wonder if we still may want to truncate eventually, users could have a truly massive line here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fair point, question is what would be a realistic value instead of 80?

@jdx jdx enabled auto-merge (squash) October 9, 2025 20:58
@jdx jdx merged commit fb2c155 into jdx:main Oct 9, 2025
24 checks passed
@roele roele deleted the issues/6618 branch October 9, 2025 21:20
jdx pushed a commit that referenced this pull request Oct 10, 2025
### 📦 Registry

- add lazyssh by @TyceHerrman in
[#6610](#6610)

### 🚀 Features

- **(config)** Add a ceiling to how mise searchs for config & tasks by
@richardthe3rd in [#6041](#6041)

### 🐛 Bug Fixes

- **(task)** use config_root instead of project_root for task base path
by @risu729 in [#6609](#6609)
- **(task)** resolve project tasks in run blocks using TaskLoadContext
by @jdx in [#6614](#6614)
- **(task)** dont truncate task message when CI is set by @roele in
[#6620](#6620)
- **(ui)** prevent OSC 9;4 progress sequences from being written to
non-terminals by @jdx in [#6615](#6615)

### Chore

- remove cosign/slsa-verifier from mise.toml by @jdx in
[#6616](#6616)

### New Contributors

- @richardthe3rd made their first contribution in
[#6041](#6041)
@zeitlinger
Copy link
Copy Markdown
Contributor

thank you!

@jdx
Copy link
Copy Markdown
Owner

jdx commented Nov 1, 2025

@roele I'm not a fan of this
Screenshot 2025-11-01 at 09 27 35

maybe we could only show the first line?

@roele
Copy link
Copy Markdown
Contributor Author

roele commented Nov 1, 2025

Have to agree on this, showing the entire output is not a good idea 🤔

jdx added a commit that referenced this pull request Nov 2, 2025
Partially reverts the CI-specific behavior from #6620. Instead of showing
the full command in CI mode and truncating with ellipsis in non-CI mode,
now always shows just the first line of the command without any truncation
character, regardless of CI setting.

This provides consistent behavior across all environments while keeping
the display clean and predictable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
jdx added a commit that referenced this pull request Nov 2, 2025
Partially reverts the CI-specific behavior from #6620. Instead of showing
the full command in CI mode and truncating with ellipsis in non-CI mode,
now always shows just the first line of the command without any truncation
character, regardless of CI setting.

This provides consistent behavior across all environments while keeping
the display clean and predictable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
jdx added a commit that referenced this pull request Nov 2, 2025
)

## Summary

Simplifies task command display to always show just the first line, with
different truncation behavior based on environment.

## Changes

**Before:**
- In CI mode: showed full command (potentially multiple lines)
- In non-CI mode: showed first line truncated to terminal width with "…"

**After:**
- In CI mode: shows full first line without truncation
- In non-CI mode: shows first line truncated to terminal width with "…"

This maintains the terminal width truncation for non-CI environments
(like before #6620) while keeping the CI improvement from #6620, but now
both modes only show the first line of multi-line commands.

## Implementation

- Updated `src/task/task_output.rs::trunc()` to always extract first
line before applying truncation logic
- Kept CI-specific logic to skip truncation in CI mode
- Updated function documentation

## Test Plan

- ✅ Existing test `test_task_display_truncation` passes (verifies no "…"
character in CI mode)
- ✅ All task output tests pass
- ✅ Clean and predictable display in all environments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
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.

5 participants