ruvnet/ruflo · error · QECoreError

Failed to terminate agent

Error message

Failed to terminate agent

What it means

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.

Source

Thrown at v3/plugins/agentic-qe/src/bridges/QECoreBridge.ts:490

    this.type = agent.type;
    this.name = agent.name;
    this._status = agent.status;
    this.agentService = agentService;
    this.logger = logger;
  }

  get status(): AgentHandle['status'] {
    return this._status;
  }

  async terminate(): Promise<void> {
    try {
      this.logger.debug(`Terminating agent: ${this.id}`);
      await this.agentService.terminate(this.id);
      this._status = 'terminated';
    } catch (error) {
      this.logger.error(`Failed to terminate agent: ${this.id}`, error);
      throw new QECoreError('Failed to terminate agent', error as Error);
    }
  }

  async send(message: Record<string, unknown>): Promise<void> {
    try {
      this.logger.debug(`Sending message to agent: ${this.id}`);
      await this.agentService.sendMessage(this.id, message);
    } catch (error) {
      this.logger.error(`Failed to send message to agent: ${this.id}`, error);
      throw new QECoreError('Failed to send message', error as Error);
    }
  }
}

/**
 * Task Handle Implementation
 */
class TaskHandleImpl implements TaskHandle {

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Check the agent exists and is in a terminable state.
  2. Inspect the underlying error from the terminate call.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at v3/plugins/agentic-qe/src/bridges/QECoreBridge.ts:490 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/b7456a0a36a89096. Report an issue: GitHub.