Skip to content

Conversation

@AgentEnder
Copy link
Member

Current Behavior

The printTaskTerminalOutput callback in the TUI summary life cycle overwrites terminal output for all tasks when output is provided. This causes the command line information (the actual command that was run) to be lost for non-cached tasks because non-cached tasks stream their output via appendTaskOutput, which includes the command information.

Expected Behavior

For non-cached tasks (those with 'failure' or 'success' status), the output should be preserved from the streaming via appendTaskOutput which includes the complete command line that was executed. Only cached tasks should have their output overwritten by printTaskTerminalOutput since they don't go through the streaming path.

Related Issue(s)

🤖 Generated with Claude Code

The printTaskTerminalOutput callback was overwriting terminal output for
all tasks, which caused the command line information to be lost for
non-cached tasks. For non-cached tasks, output is streamed via
appendTaskOutput which includes the command that was run. This fix only
overwrites the output for cached tasks (those with statuses other than
'failure' or 'success') to preserve the complete output including the
command information.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@AgentEnder AgentEnder requested a review from a team as a code owner December 1, 2025 15:01
@AgentEnder AgentEnder requested a review from MaxKless December 1, 2025 15:01
@vercel
Copy link

vercel bot commented Dec 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Dec 2, 2025 4:06am

@netlify
Copy link

netlify bot commented Dec 1, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit eaf8f38
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/692e64c45839410008133f9d
😎 Deploy Preview https://deploy-preview-33673--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Dec 1, 2025

View your CI Pipeline Execution ↗ for commit eaf8f38

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 6m 44s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 53s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 12s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-05 02:02:11 UTC

@AgentEnder AgentEnder requested a review from a team as a code owner December 1, 2025 18:38
…nal.rs

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
nx-cloud[bot]

This comment was marked as outdated.

Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.com>
Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

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

❌ The fix was rejected

We've reverted the nullish coalescing assignment (??=) back to direct assignment (=) for NX_TUI when running single tasks. This ensures TUI mode is always disabled for single-task execution, allowing e2e tests to properly capture stdout output. The change in run-command.ts was preventing tests from capturing console output when NX_TUI was pre-set to 'true' in the test environment.

We could not verify this fix.

Suggested Fix changes
diff --git a/packages/nx/src/tasks-runner/run-command.ts b/packages/nx/src/tasks-runner/run-command.ts
index aecfd6a7a0..cf70fc9a10 100644
--- a/packages/nx/src/tasks-runner/run-command.ts
+++ b/packages/nx/src/tasks-runner/run-command.ts
@@ -95,7 +95,7 @@ async function getTerminalOutputLifeCycle(
   const isRunOne = initiatingProject != null;
 
   if (tasks.length === 1) {
-    process.env.NX_TUI ??= 'false';
+    process.env.NX_TUI = 'false';
   }
 
   if (isTuiEnabled()) {

View interactive diff ↗
This fix was rejected by Craigory Coppola


🎓 Learn more about Self-Healing CI on nx.dev

@FrozenPandaz FrozenPandaz merged commit 72c47e7 into master Dec 15, 2025
21 of 22 checks passed
@FrozenPandaz FrozenPandaz deleted the fix/tui-summary-preserve-command-output branch December 15, 2025 16:50
FrozenPandaz pushed a commit that referenced this pull request Dec 15, 2025
#33673)

## Current Behavior

The `printTaskTerminalOutput` callback in the TUI summary life cycle
overwrites terminal output for all tasks when output is provided. This
causes the command line information (the actual command that was run) to
be lost for non-cached tasks because non-cached tasks stream their
output via `appendTaskOutput`, which includes the command information.

## Expected Behavior

For non-cached tasks (those with 'failure' or 'success' status), the
output should be preserved from the streaming via `appendTaskOutput`
which includes the complete command line that was executed. Only cached
tasks should have their output overwritten by `printTaskTerminalOutput`
since they don't go through the streaming path.

## Related Issue(s)

<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.com>
(cherry picked from commit 72c47e7)
FrozenPandaz pushed a commit that referenced this pull request Dec 15, 2025
#33673)

## Current Behavior

The `printTaskTerminalOutput` callback in the TUI summary life cycle
overwrites terminal output for all tasks when output is provided. This
causes the command line information (the actual command that was run) to
be lost for non-cached tasks because non-cached tasks stream their
output via `appendTaskOutput`, which includes the command information.

## Expected Behavior

For non-cached tasks (those with 'failure' or 'success' status), the
output should be preserved from the streaming via `appendTaskOutput`
which includes the complete command line that was executed. Only cached
tasks should have their output overwritten by `printTaskTerminalOutput`
since they don't go through the streaming path.

## Related Issue(s)

<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.com>
(cherry picked from commit 72c47e7)
FrozenPandaz pushed a commit that referenced this pull request Dec 15, 2025
#33673)

## Current Behavior

The `printTaskTerminalOutput` callback in the TUI summary life cycle
overwrites terminal output for all tasks when output is provided. This
causes the command line information (the actual command that was run) to
be lost for non-cached tasks because non-cached tasks stream their
output via `appendTaskOutput`, which includes the command information.

## Expected Behavior

For non-cached tasks (those with 'failure' or 'success' status), the
output should be preserved from the streaming via `appendTaskOutput`
which includes the complete command line that was executed. Only cached
tasks should have their output overwritten by `printTaskTerminalOutput`
since they don't go through the streaming path.

## Related Issue(s)

<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.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.

3 participants