fix(session): stop reporting user-cancelled tools as tool errors

Draft
AL
7d ago
+62-0

Summary

Automated fix proposed by the Altimate software factory; a maintainer reviews every change.

The problem, fix and criteria below are the agent's own account; check them against the diff.

Problem

When a session was stopped, every unfinished tool part was closed as the error 'Tool execution aborted', and the prompt loop reported each one as an error_fingerprint tool failure even though the user had asked for the cancellation.

Fix

Tools the user's own Stop interrupted are no longer sent as error_fingerprint tool errors, while unrequested interruptions and real tool failures are still reported.

Acceptance criteria

  • An interrupted tool part is not tracked as a tool error when the session's abort signal fired
  • An interrupted tool part is still tracked when the session did not request the abort
  • A genuine tool error is tracked whether or not the session aborted

Changes

3 files changed, 62 lines added, 0 lines removed.

  • packages/opencode/src/session/processor.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/session/processor-tool-abort-telemetry.test.ts

New tests

  • packages/opencode/test/session/processor-tool-abort-telemetry.test.ts

Independent review: accepted, confidence 0.88

Verification

  • Verify job: passed

Summary by cubic

Stops reporting tools interrupted by the user's own Stop as error_fingerprint tool errors in telemetry.

  • Tool parts closed as "Tool execution aborted" after the session's abort signal fired are no longer tracked as tool errors.
  • Interruptions the session did not request and genuine tool failures are still reported.