Files
openclaw/test/scripts
thomas.szbay db482e6e97 fix(agents): race in-flight tool promises against run abort (#103905) (#110704)
* fix(agents): race in-flight tool promises against run abort (#103905)

wrapToolWithAbortSignal forwarded the combined abort signal into tool
execute calls but awaited the returned promise without racing it, so a
tool that never observes the signal kept running after stuck-session
recovery aborted the run and delivered its result into a dead run.

Race the execute promise against the combined signal so the wrapped
call rejects with AbortError as soon as the abort fires. The tool
promise itself cannot be cancelled in JavaScript; it keeps running in
the background and its late settlement is detached so it never lands
in the aborted run. Tool results and errors pass through unchanged
while the run is alive.

Refs #103905

* fix(agents): satisfy oxlint abort-race rejection rules without losing tool errors

* fix(lint): annotate intentional non-Error pass-through rejections

The race intentionally forwards tool rejections untouched (including
non-Error values), which trips oxlint's promise-rejection rules; mark
both sites with oxlint-disable-next-line justifications.

* test(scripts): allowlist intentional abort-race rejection suppression

The raw non-Error pass-through reject() in agent-tools.abort.ts is the
documented tool-error contract; register its prefer-promise-reject-errors
suppression in the production allowlist.

* fix(agents): observe sync-aborted tool rejections

Co-authored-by: thomas.szbay <thomas.szbay@xydigit.com>

---------

Co-authored-by: thomas.szbay <thomas.szbay@example.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: thomas.szbay <thomas.szbay@xydigit.com>
2026-07-20 21:24:52 -07:00
..
2026-06-04 20:49:50 -04:00
2026-06-04 20:49:50 -04:00
2026-06-04 20:49:50 -04:00