Files
openclaw/src/trajectory
simonusa 7cdbfc9649 fix(agents): distinguish terminal aborts from retryable failures (#60388) (#62682)
* fix(agents): terminal-abort coverage beyond #87085's isTerminalAbort (closes #60388)

PR #87085 landed the base isTerminalAbort(signal) check (TimeoutError /
ClientDisconnectError on signal.reason) plus abortSignal threading through
the model-fallback and chat-side callers. This change adds the coverage that
PR #87085 did not include:

- ClientDisconnectError class + wiring in http-common.ts so the
  reason.name === "ClientDisconnectError" branch PR #87085 added is actually
  reachable (upstream watchClientDisconnect still aborts bare).
- cron run-budget string reasons (prefix match) — cron timer aborts with a
  plain string, which the Error-only base check skips.
- .cause-chain walking + isTerminalAbortFromError gated on the
  OPENCLAW_ABORTABLE_WRAPPER marker, for the embedded run-budget timer that
  aborts a private controller (not the caller signal).
- compaction-path abortSignal forwarding (compactEmbeddedPiSessionDirect).
- timedOutByRunBudget plumbing through attempt/failover-policy/assistant-failover
  so run-budget timeouts skip the fallback chain and wasted compaction.

* fix(agents): preserve wrapped restart aborts

* refactor: dedupe terminal abort classification

---------

Co-authored-by: Altay <altay@hey.com>
2026-07-06 17:48:50 +03:00
..