{"record":{"id":"33c37a7ed0cd0aec","repo":"ruvnet/ruflo","slug":"worker-this-id-is-terminated","errorCode":null,"errorMessage":"Worker ${this.id} is terminated","messagePattern":"Worker (.+?) is terminated","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/plugins/src/workers/index.ts","lineNumber":146,"sourceCode":"  }\n\n  private initMetrics(): WorkerMetrics {\n    return {\n      tasksExecuted: 0,\n      tasksSucceeded: 0,\n      tasksFailed: 0,\n      avgDuration: 0,\n      totalTokensUsed: 0,\n      currentLoad: 0,\n      uptime: 0,\n      lastActivity: Date.now(),\n      healthScore: 1.0,\n    };\n  }\n\n  async execute(task: WorkerTask): Promise<WorkerTaskResult> {\n    if (this._status === 'terminated') {\n      throw new Error(`Worker ${this.id} is terminated`);\n    }\n\n    this._status = 'busy';\n    this._currentTask = task;\n    this.lastActivity = Date.now();\n    const startTime = Date.now();\n\n    try {\n      // Execute task via agentic-flow task runner\n      const result = await this.executeTask(task);\n\n      const duration = Date.now() - startTime;\n      this.updateMetrics(true, duration, result.tokensUsed);\n\n      this._status = 'idle';\n      this._currentTask = undefined;\n\n      return {","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/plugins/src/workers/index.ts#L128-L164","documentation":"WorkerInstance.execute was invoked after the worker reached the 'terminated' status. A terminated worker has been torn down and cannot accept tasks, so any queued or in-flight dispatch to this worker id is rejected as an illegal lifecycle use.","triggerScenarios":"An operation is attempted on a worker that has already been terminated.","commonSituations":"Posting tasks or messages to a worker after terminate() was called.","solutions":["Check the worker's terminated state before using it.","Spawn a new worker if more work remains after termination."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}