fix(telemetry): stop reporting requested tool aborts as tool errors
Draft
AL
6d ago+60+60+01234567890123456789-0-0-0123456789
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 closes running tools as errors with 'Tool execution aborted', and the prompt loop counted those requested cancellations as tool failures in error_fingerprint telemetry.
Fix
Error fingerprint telemetry now skips tools that were closed because the session itself was aborted, and still reports unrequested interruptions and real tool errors.
Acceptance criteria
- A tool part with status error, error 'Tool execution aborted' and metadata.interrupted true produces no error_fingerprint when the session abort signal fired
- The same interrupted part is still fingerprinted when the session abort signal did not fire
- Real tool errors such as 'File not found' are still fingerprinted during an aborted session
- An aborted-message part without the interrupted marker is still fingerprinted
Changes
3 files changed, 60 lines added, 0 lines removed.
packages/opencode/src/altimate/telemetry/error-detail.tspackages/opencode/src/session/prompt.tspackages/opencode/test/telemetry/error-fingerprint-requested-abort.test.ts
New tests
packages/opencode/test/telemetry/error-fingerprint-requested-abort.test.ts
Independent review: accepted, confidence 0.86
Verification
- Verify job: passed
Summary by cubic
Stops reporting requested tool aborts as tool errors in error_fingerprint telemetry.
- Skips tools the processor closed because the session's own abort signal fired (Stop/Esc, dispose), which is already recorded as the session's "aborted" outcome.
- Interruptions the session did not request and real tool errors are still fingerprinted.
- Adds
isRequestedToolInterruptioninpackages/opencode/src/altimate/telemetry/error-detail.tsand a check inpackages/opencode/src/session/prompt.ts. - Adds tests covering requested aborts, unrequested interruptions, real tool errors, and aborted parts without the interrupted marker.