Skip to content

fix(cli): report build log stream failures clearly and exit instead of hanging - #4887

Open
myftija wants to merge 6 commits into
mainfrom
fix/cli-deploy-log-stream-error
Open

fix(cli): report build log stream failures clearly and exit instead of hanging#4887
myftija wants to merge 6 commits into
mainfrom
fix/cli-deploy-log-stream-error

Conversation

@myftija

@myftija myftija commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

When the build log stream failed during a build server deploy, the CLI printed the raw stream error (e.g. X Error: Invalid access token) and then hung the process. Only the log stream was lost, the deployment itself kept running.

The CLI now stops the spinner, says the log stream failed and that the deployment continues on the build server, links the dashboard, and exits 1 right away. The non-zero exit is deliberate: the CLI can no longer confirm the outcome. Failing to open the stream now behaves the same way instead of exiting 0.

Fix

  • One handler for both stream failures that prints the message and throws an OutroCommandError, which exits the process instead of waiting for open handles.
  • Return from the event loop on the finalized event, which cancels the read session directly. A late transport error can no longer discard a result already received or keep the stream reconnecting after the build is done.

…d of hanging

When the log stream for a build server deploy fails mid-build, the CLI
printed the raw stream error and then kept running until some handle
timed out about an hour later. It now stops the spinner, says the stream
was lost and that the deployment itself is still running, and exits with
code 1 right away, since it cannot know the final outcome.
…arrives

Returning from the event loop cancels the underlying read session, so a
late transport error cannot discard a finalized result that was already
received, and the stream cannot keep reconnecting after the build is done.
Failing to open the stream and losing it mid-build leave the CLI in the
same position, unable to confirm the deployment outcome, so both now use
the same message and exit code.
@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2a0691b

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

This PR includes changesets to release 27 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/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/metrics-pipeline Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/run-store Patch
@internal/schedule-engine Patch
@internal/tracing Patch
@internal/webhook-engine Patch
@internal/webhook-sources Patch
@internal/testcontainers Patch
@internal/cache 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

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 8105f2e9-c03b-45fa-9ebe-f373941205da

📥 Commits

Reviewing files that changed from the base of the PR and between 0fe474b and 2a0691b.

📒 Files selected for processing (1)
  • packages/cli-v3/src/commands/deploy.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/cli-v3/src/commands/deploy.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (41)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (22, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (24, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (18, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (20, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (17, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (15, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (23, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (19, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (21, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (16, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (12, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (14, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (13, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 24)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (2, 2)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: e2e / 🧪 CLI v3 tests (warp-ubuntu-latest-x64-4x - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (warp-windows-latest-x64-8x - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (warp-ubuntu-latest-x64-4x - pnpm)
  • GitHub Check: internal / 🧪 Unit Tests: Internal
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: e2e / 🧪 CLI v3 tests (warp-windows-latest-x64-8x - npm)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (1, 2)
  • GitHub Check: fk-cascade-guard / fk-cascade-guard
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: runops-guard / runops-guard
  • GitHub Check: typecheck / typecheck
  • GitHub Check: code-quality / code-quality
  • GitHub Check: audit
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build and publish previews

Walkthrough

The CLI now converts build log stream and read-session failures into a non-zero OutroCommandError with renderer output and normalized error details. streamDeploymentEvents returns immediately after a finalized event and releases the stream. A test verifies this behavior. A patch changeset documents the CLI update.

Merge Risk: 🔵 Low · up to 2a069

The CLI now surfaces build log stream failures as deployment errors while the server-side deployment continues. Required telemetry instrumentation remains absent from changed paths, reducing operational visibility into this failure behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the bug and the fix, but it omits the required issue reference, checklist, Testing section, Changelog section, and Screenshots section. Update the description to follow the repository template. Add a Closes # reference, complete the checklist, document the test steps and results, add a short changelog entry, and include screenshots or state that they are not applicab…
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: reporting build log stream failures and exiting instead of hanging.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Resolution

Update the description to follow the repository template. Add a Closes #<issue> reference, complete the checklist, document the test steps and results, add a short changelog entry, and include screenshots or state that they are not applicable.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cli-deploy-log-stream-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.

❤️ 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.

Devin Review

coderabbitai[bot]

This comment was marked as resolved.

@pkg-pr-new

pkg-pr-new Bot commented Sep 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@2a0691b

trigger.dev

npm i https://pkg.pr.new/trigger.dev@2a0691b

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@2a0691b

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@2a0691b

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@2a0691b

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@2a0691b

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@2a0691b

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@2a0691b

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@2a0691b

commit: 2a0691b

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.

1 participant