{"record":{"id":"b7456a0a36a89096","repo":"ruvnet/ruflo","slug":"failed-to-terminate-agent","errorCode":null,"errorMessage":"Failed to terminate agent","messagePattern":"Failed to terminate agent","errorType":"exception","errorClass":"QECoreError","httpStatus":null,"severity":"error","filePath":"v3/plugins/agentic-qe/src/bridges/QECoreBridge.ts","lineNumber":490,"sourceCode":"    this.type = agent.type;\n    this.name = agent.name;\n    this._status = agent.status;\n    this.agentService = agentService;\n    this.logger = logger;\n  }\n\n  get status(): AgentHandle['status'] {\n    return this._status;\n  }\n\n  async terminate(): Promise<void> {\n    try {\n      this.logger.debug(`Terminating agent: ${this.id}`);\n      await this.agentService.terminate(this.id);\n      this._status = 'terminated';\n    } catch (error) {\n      this.logger.error(`Failed to terminate agent: ${this.id}`, error);\n      throw new QECoreError('Failed to terminate agent', error as Error);\n    }\n  }\n\n  async send(message: Record<string, unknown>): Promise<void> {\n    try {\n      this.logger.debug(`Sending message to agent: ${this.id}`);\n      await this.agentService.sendMessage(this.id, message);\n    } catch (error) {\n      this.logger.error(`Failed to send message to agent: ${this.id}`, error);\n      throw new QECoreError('Failed to send message', error as Error);\n    }\n  }\n}\n\n/**\n * Task Handle Implementation\n */\nclass TaskHandleImpl implements TaskHandle {","sourceCodeStart":472,"sourceCodeEnd":508,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/agentic-qe/src/bridges/QECoreBridge.ts#L472-L508","documentation":"AgentHandleImpl.terminate caught an error from agentService.terminate(this.id) and rethrew as QECoreError after logging. The QE core refused or failed to terminate the agent (already gone or service error); the handle's status is left unchanged.","triggerScenarios":"Thrown at v3/plugins/agentic-qe/src/bridges/QECoreBridge.ts:490 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the agent exists and is in a terminable state.","Inspect the underlying error from the terminate 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"}