{"record":{"id":"4ac772f93bd63309","repo":"ruvnet/ruflo","slug":"failed-to-cancel-task","errorCode":null,"errorMessage":"Failed to cancel task","messagePattern":"Failed to cancel task","errorType":"exception","errorClass":"QECoreError","httpStatus":null,"severity":"error","filePath":"v3/plugins/agentic-qe/src/bridges/QECoreBridge.ts","lineNumber":558,"sourceCode":"        success: result.success,\n        data: result.data,\n        error: result.error,\n        durationMs: result.durationMs,\n      };\n    } catch (error) {\n      this.logger.error(`Failed to wait for task: ${this.id}`, error);\n      throw new QECoreError('Failed to wait for task', error as Error);\n    }\n  }\n\n  async cancel(): Promise<void> {\n    try {\n      this.logger.debug(`Cancelling task: ${this.id}`);\n      await this.taskService.cancel(this.id);\n      this._status = 'cancelled';\n    } catch (error) {\n      this.logger.error(`Failed to cancel task: ${this.id}`, error);\n      throw new QECoreError('Failed to cancel task', error as Error);\n    }\n  }\n\n  async getProgress(): Promise<TaskProgress> {\n    try {\n      const status = await this.taskService.getStatus(this.id);\n      this._status = status.status;\n\n      return {\n        percentage: status.progress || 0,\n        currentStep: status.currentStep || 'Unknown',\n        totalSteps: status.totalSteps || 0,\n        completedSteps: status.completedSteps || 0,\n        estimatedRemainingMs: this.estimateRemaining(status),\n      };\n    } catch (error) {\n      this.logger.error(`Failed to get task progress: ${this.id}`, error);\n      throw new QECoreError('Failed to get progress', error as Error);","sourceCodeStart":540,"sourceCodeEnd":576,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/agentic-qe/src/bridges/QECoreBridge.ts#L540-L576","documentation":"The QECoreBridge task's cancel() propagated an exception from the underlying taskService (task already terminal, connection lost, or unknown task). The catch logs the task id and wraps the failure in QECoreError so callers see a uniform bridge-level cancel failure.","triggerScenarios":"Thrown at v3/plugins/agentic-qe/src/bridges/QECoreBridge.ts:558 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the task is in a cancellable state before cancelling.","Inspect the underlying error from the cancel call."],"exampleFix":null,"handlingStrategy":"try-catch","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-14T05:17:10.506Z"}