trigger.dev 0.0.0-v3-canary-20240321210113 → 0.0.0-v3-canary-20240322104917

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -800,7 +800,7 @@ import invariant from "tiny-invariant";
800
800
  import { z as z4 } from "zod";
801
801
 
802
802
  // package.json
803
- var version = "0.0.0-v3-canary-20240321210113";
803
+ var version = "0.0.0-v3-canary-20240322104917";
804
804
  var dependencies = {
805
805
  "@baselime/node-opentelemetry": "^0.4.6",
806
806
  "@clack/prompts": "^0.7.0",
@@ -821,7 +821,7 @@ var dependencies = {
821
821
  "@opentelemetry/sdk-trace-node": "^1.21.0",
822
822
  "@opentelemetry/semantic-conventions": "^1.21.0",
823
823
  "@traceloop/instrumentation-openai": "^0.3.9",
824
- "@trigger.dev/core": "workspace:0.0.0-v3-canary-20240321210113",
824
+ "@trigger.dev/core": "workspace:0.0.0-v3-canary-20240322104917",
825
825
  "@types/degit": "^2.8.3",
826
826
  chalk: "^5.2.0",
827
827
  chokidar: "^3.5.3",
@@ -3930,6 +3930,7 @@ var BackgroundWorker = class {
3930
3930
  }
3931
3931
  if (!this._taskRunProcesses.has(payload.execution.run.id)) {
3932
3932
  const taskRunProcess = new TaskRunProcess(
3933
+ payload.execution.run.id,
3933
3934
  this.path,
3934
3935
  {
3935
3936
  ...this.params.env,
@@ -4039,7 +4040,8 @@ var BackgroundWorker = class {
4039
4040
  }
4040
4041
  };
4041
4042
  var TaskRunProcess = class {
4042
- constructor(path6, env, metadata, worker) {
4043
+ constructor(runId, path6, env, metadata, worker) {
4044
+ this.runId = runId;
4043
4045
  this.path = path6;
4044
4046
  this.env = env;
4045
4047
  this.metadata = metadata;
@@ -4048,7 +4050,8 @@ var TaskRunProcess = class {
4048
4050
  schema: workerToChildMessages,
4049
4051
  sender: async (message) => {
4050
4052
  if (this._child?.connected && !this._isBeingKilled && !this._child.killed) {
4051
- this._child?.send?.(message);
4053
+ logger.debug(`[${this.runId}] sending message to task run process`, { message });
4054
+ this._child.send(message);
4052
4055
  }
4053
4056
  }
4054
4057
  });
@@ -4070,10 +4073,9 @@ var TaskRunProcess = class {
4070
4073
  await this.cleanup(true);
4071
4074
  }
4072
4075
  async initialize() {
4073
- logger.debug("initializing task run process", {
4076
+ logger.debug(`[${this.runId}] initializing task run process`, {
4074
4077
  env: this.env,
4075
- path: this.path,
4076
- processEnv: process.env
4078
+ path: this.path
4077
4079
  });
4078
4080
  this._child = fork(this.path, {
4079
4081
  stdio: [
@@ -4105,6 +4107,7 @@ var TaskRunProcess = class {
4105
4107
  if (kill && this._isBeingKilled) {
4106
4108
  return;
4107
4109
  }
4110
+ logger.debug(`[${this.runId}] cleaning up task run process`, { kill });
4108
4111
  await this._sender.send("CLEANUP", {
4109
4112
  flush: true,
4110
4113
  kill
@@ -4135,6 +4138,10 @@ var TaskRunProcess = class {
4135
4138
  if (!completion.ok && typeof completion.retry !== "undefined") {
4136
4139
  return;
4137
4140
  }
4141
+ if (execution.run.id === this.runId) {
4142
+ return;
4143
+ }
4144
+ logger.debug(`[${this.runId}] task run completed notification`, { completion, execution });
4138
4145
  this._sender.send("TASK_RUN_COMPLETED_NOTIFICATION", {
4139
4146
  completion,
4140
4147
  execution
@@ -4172,6 +4179,7 @@ var TaskRunProcess = class {
4172
4179
  }
4173
4180
  }
4174
4181
  async #handleExit(code) {
4182
+ logger.debug(`[${this.runId}] task run process exiting`, { code });
4175
4183
  for (const [id, status] of this._attemptStatuses.entries()) {
4176
4184
  if (status === "PENDING") {
4177
4185
  this._attemptStatuses.set(id, "REJECTED");