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

Draft
AL
4d ago
+43-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 is aborted, the processor marks still-running tool parts as errors with 'Tool execution aborted', and the prompt loop counted those as tool failures in error_fingerprint telemetry.

Fix

Tool parts closed because the user aborted the session are no longer sent as error_fingerprint tool errors, while aborts the session did not request and real tool errors are still reported.

Acceptance criteria

  • A tool part marked interrupted with error 'Tool execution aborted' produces no error_fingerprint event when the session abort signal was set
  • An interrupted tool part produces an error_fingerprint event when the session abort signal was not set
  • A tool error without interrupted metadata is still recorded during an aborted session

Changes

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

  • packages/opencode/src/altimate/telemetry/error-detail.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/telemetry/error-detail-requested-abort.test.ts

New tests

  • packages/opencode/test/telemetry/error-detail-requested-abort.test.ts

Independent review: accepted, confidence 0.82

Verification

  • Verify job: passed

Summary by cubic

Stops reporting tools the user cancelled as error_fingerprint tool errors.

When a session is aborted, tool parts interrupted by that abort were previously counted as tool failures in error_fingerprint telemetry. They're now skipped, while interrupts the session didn't request and real tool errors are still reported.