Skip to content

Conversation

@deepshekhardas
Copy link

@deepshekhardas deepshekhardas commented Feb 11, 2026

Consolidated Bug Fixes

This PR combines fixes for several independent issues identified in the codebase, covering CLI stability, deployment/build reliability, and runtime correctness.

Fixes

Issue / Feature Description
Orphaned Workers Fixes trigger dev leaving orphaned trigger-dev-run-worker processes by ensuring graceful shutdown on SIGINT/SIGTERM and robust process cleanup.
Sentry Interception Fixes ConsoleInterceptor swallowing logs when Sentry (or other monkey-patchers) are present by delegating to the original preserved console methods.
Engine Strictness Fixes deployment failures on GitHub Integration when engines.node is strict (e.g. "22") by passing --no-engine-strict (and equivalents) during the trigger deploy build phase.
Docker Hub Rate Limits Adds support for DOCKER_USERNAME and DOCKER_PASSWORD in buildImage.ts to authenticate with Docker Hub and avoid rate limits during native builds.
Dead Process Hang Fixes a hang in TaskRunProcess.execute() by checking specific process connectivity before attempting to send IPC messages.
Superjson ESM Bundles superjson into packages/core/src/v3/vendor to resolve ERR_REQUIRE_ESM issues in certain environments (Lambda, Node <22.12).
Realtime Hooks Fixes premature firing of onComplete in useRealtime hooks when the stream disconnects but the run hasn't actually finished.
Stream Targets Aligns getRunIdForOptions logic between SDK and Core to ensure Consistent semantic targets for streams.
Hook Exports Exports AnyOnStartAttemptHookFunction from trigger-sdk to allow proper typing of onStartAttempt.

Verification

Automated Verification

  • Engine Strictness: Pass in packages/cli-v3/src/commands/update.test.ts.
  • Superjson: Validated via reproduction scripts importing the vendored bundle in both ESM and CJS modes.
  • Sentry: Validated via repro_2900_sentry.ts script ensuring logs flow through Sentry patches.

Manual Verification

  • Orphaned Workers: Verified locally by interrupting trigger dev and observing process cleanup.
  • Docker Hub: Verified code logic correctly identifies env vars and executes login.
  • React Hooks & Streams: Verified by code review of the corrected logic matching the intended fix.

Changesets

  • fix-orphaned-workers-2909
  • fix-sentry-console-interceptor-2900
  • fix-github-install-node-version-2913
  • fix-docker-hub-rate-limit-2911
  • fix-dead-process-execute-hang
  • vendor-superjson-esm-fix
  • calm-hooks-wait
  • consistent-stream-targets
  • export-start-attempt-hook-type

Open with Devin

Deploy Bot and others added 15 commits February 2, 2026 16:16
- Include reproduction scripts for Sentry (triggerdotdev#2900) and engine strictness (triggerdotdev#2913)
- Include PR body drafts for consolidated tracking
- Include reproduction scripts for Sentry (triggerdotdev#2900) and engine strictness (triggerdotdev#2913)
- Include PR body drafts for consolidated tracking
@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: be79cf2

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

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
Contributor

Hi @deepshekhardas, 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 Feb 11, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request consolidates multiple independent bug fixes and enhancements across the CLI, deployment, build, and runtime layers. Changes include: signal handling for graceful shutdown of dev processes and orphaned workers; Docker Hub authentication during builds to handle rate limits; engine strictness control during deployments to support varying Node.js versions; Docker containerfile generation with package manager and lockfile support; source map support refactoring with environment-based configuration; a memory management utility to respawn the CLI with increased heap when needed; improvements to the console interceptor to delegate to original console methods; enhanced error handling for resource-exhausted scenarios; key escaping in attribute flattening utilities; test coverage for new functionality; and dependency version updates.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ddeb9c4 and be79cf2.

📒 Files selected for processing (34)
  • .changeset/fix-console-interceptor-2900.md
  • .changeset/fix-docker-hub-rate-limit-2911.md
  • .changeset/fix-github-install-node-version-2913.md
  • .changeset/fix-orphaned-workers-2909.md
  • .changeset/fix-sentry-oom-2920.md
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/package.json
  • consolidated_pr_body.md
  • packages/cli-v3/package.json
  • packages/cli-v3/src/build/buildWorker.ts
  • packages/cli-v3/src/build/bundle.test.ts
  • packages/cli-v3/src/build/bundle.ts
  • packages/cli-v3/src/cli/common.ts
  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/dev.ts
  • packages/cli-v3/src/commands/login.ts
  • packages/cli-v3/src/commands/update.test.ts
  • packages/cli-v3/src/commands/update.ts
  • packages/cli-v3/src/deploy/buildImage.test.ts
  • packages/cli-v3/src/deploy/buildImage.ts
  • packages/cli-v3/src/entryPoints/dev-index-worker.ts
  • packages/cli-v3/src/entryPoints/dev-run-worker.ts
  • packages/cli-v3/src/entryPoints/managed-index-worker.ts
  • packages/cli-v3/src/entryPoints/managed-run-worker.ts
  • packages/cli-v3/src/index.ts
  • packages/cli-v3/src/utilities/memory.test.ts
  • packages/cli-v3/src/utilities/memory.ts
  • packages/cli-v3/src/utilities/sourceMaps.test.ts
  • packages/cli-v3/src/utilities/sourceMaps.ts
  • packages/core/src/v3/consoleInterceptor.ts
  • packages/core/src/v3/errors.test.ts
  • packages/core/src/v3/errors.ts
  • packages/core/src/v3/utils/flattenAttributes.ts
  • packages/core/test/flattenAttributes.test.ts

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 and usage tips.

Copy link

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

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 7 additional findings in Devin Review.

Open in Devin Review

@@ -260,8 +261,7 @@ export async function updateTriggerPackages(
await installDependencies({ cwd: projectPath, silent: true });

Choose a reason for hiding this comment

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

🔴 ignoreEngines option is plumbed through but never passed to installDependencies

The ignoreEngines option is added to CommonCommandOptions, picked into UpdateCommandOptions, and passed as true from deploy.ts:255, but the actual installDependencies call at packages/cli-v3/src/commands/update.ts:261 completely ignores it:

await installDependencies({ cwd: projectPath, silent: true });

No args are constructed or passed based on options.ignoreEngines or the detected packageManager.

Root Cause and Impact

The PR description states this fixes "deployment failures on GitHub Integration when engines.node is strict (e.g. "22") by passing --no-engine-strict (and equivalents) during the trigger deploy build phase." The tests in update.test.ts expect installDependencies to be called with args: ["--no-engine-strict"] for npm, args: ["--config.engine-strict=false"] for pnpm, etc. However, the implementation never constructs these args.

The packageManager is detected at line 254 but only used for display messages. The options.ignoreEngines flag is available in scope but never read. This means the entire Engine Strictness fix is non-functional — deployments will still fail when engines.node is strict on the build server.

All four tests in update.test.ts will fail because installDependencies is called without the expected args parameter.

Prompt for agents
In packages/cli-v3/src/commands/update.ts, the installDependencies call at line 261 needs to pass engine-ignoring args based on options.ignoreEngines and the detected packageManager. Replace the installDependencies call around lines 254-261 with logic like:

1. After detecting the packageManager at line 254, compute the args array:
   - If options.ignoreEngines is true and packageManager.name is 'npm': args = ['--no-engine-strict']
   - If options.ignoreEngines is true and packageManager.name is 'pnpm': args = ['--config.engine-strict=false']
   - If options.ignoreEngines is true and packageManager.name is 'yarn': args = ['--ignore-engines']
   - Otherwise: args = []

2. Pass these args to installDependencies: await installDependencies({ cwd: projectPath, silent: true, args })

This matches the expectations in update.test.ts.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +97 to +113
switch (severityNumber) {
case SeverityNumber.INFO:
this.originalConsole.log(...args);
break;
case SeverityNumber.WARN:
this.originalConsole.warn(...args);
break;
case SeverityNumber.ERROR:
this.originalConsole.error(...args);
break;
case SeverityNumber.DEBUG:
this.originalConsole.debug(...args);
break;
default:
this.originalConsole.log(...args);
break;
}

Choose a reason for hiding this comment

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

🟡 ConsoleInterceptor routes console.info() calls to originalConsole.log() instead of originalConsole.info()

Both log() and info() use SeverityNumber.INFO as their severity number (consoleInterceptor.ts:72 and consoleInterceptor.ts:76). The new switch statement at line 97-113 only switches on severityNumber, so both map to the SeverityNumber.INFO case which calls this.originalConsole.log(...args). This means console.info() calls are incorrectly dispatched to the original console.log instead of the original console.info.

Impact on Sentry interception

The stated purpose of this change is to fix "ConsoleInterceptor swallowing logs when Sentry (or other monkey-patchers) are present by delegating to the original preserved console methods." If Sentry patches console.info specifically (which it does), those patches will be bypassed because the interceptor dispatches info calls to originalConsole.log instead of originalConsole.info.

The fix should either use severityText to distinguish between "Log" and "Info", or introduce a separate severity number for info vs log.

Suggested change
switch (severityNumber) {
case SeverityNumber.INFO:
this.originalConsole.log(...args);
break;
case SeverityNumber.WARN:
this.originalConsole.warn(...args);
break;
case SeverityNumber.ERROR:
this.originalConsole.error(...args);
break;
case SeverityNumber.DEBUG:
this.originalConsole.debug(...args);
break;
default:
this.originalConsole.log(...args);
break;
}
switch (severityNumber) {
case SeverityNumber.INFO:
if (severityText === "Info") {
this.originalConsole.info(...args);
} else {
this.originalConsole.log(...args);
}
break;
case SeverityNumber.WARN:
this.originalConsole.warn(...args);
break;
case SeverityNumber.ERROR:
this.originalConsole.error(...args);
break;
case SeverityNumber.DEBUG:
this.originalConsole.debug(...args);
break;
default:
this.originalConsole.log(...args);
break;
}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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