Skip to content

[Bug]: fix(failover): Add "abort" to timeout error patterns for fallback triggering #18453

@openagent-ai

Description

@openagent-ai

Summary

The GLM API returns "Unhandled stop reason: abort" when a stream is interrupted, but OpenClaw's failover mechanism does not recognize "abort" as a timeout error. This prevents fallback models from being triggered.

Steps to reproduce

  1. Configure GLM-5 as primary model with fallback models
  2. When GLM API returns "Unhandled stop reason: abort" (stream interrupted)
  3. Expected: Fallback to next model
  4. Actual: Error is passed through to user, no fallback triggered

Expected behavior

When the LLM returns "Unhandled stop reason: abort", it should be recognized as a timeout error and trigger fallback to the next configured model.

Actual behavior

The abort error is passed directly to the user without attempting fallback. The isFailoverErrorMessage() check fails because "abort" doesn't match any timeout pattern.

OpenClaw version

2026.2.12

Operating system

model: GLM-5 (zhipuai) • Node: v22.22.0 • OS: Linux

Install method

No response

Logs, screenshots, and evidence

Patched pi-embedded-helpers-DP9eeE_7.js locally and confirmed fallback now works correctly.

Impact and severity

In pi-embedded-helpers-DP9eeE_7.js, ERROR_PATTERNS.timeout does not include "abort":
timeout: [
"timeout",
"timed out",
"deadline exceeded",
"context deadline exceeded"
]

Additional information

Add "abort" and "stop reason: abort" to the timeout patterns:
timeout: [
"timeout",
"timed out",
"deadline exceeded",
"context deadline exceeded",
"abort",
"stop reason: abort"
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions