[GH-ISSUE #6958] [Bug] Remaining cancellation checkpoints drop the caller's abort reason #4249

Closed
opened 2026-10-31 00:48:05 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @viniciusdsandrade on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6958

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

MCP or agent integration

Observed behavior

Source-only finding at main 1d896e03b; no runtime was executed.

After #6143 and #6144, four producing checkpoints still build AnalysisCancelledError for an observed abort without the caller's signal.reason as the cause:

  • src/application/binary/BinarySession.ts: #waitForTransition (lines 1452 to 1453 for a pre-aborted signal, line 1460 for the abort listener, lines 1468 and 1476 for a transition that settles while aborted) and the two guards in withAdmittedExternalMutation (lines 738 to 739 and 741 to 742). withAdmittedAnalysis returns the wait result directly (line 1143), so a session-backed MCP server refuses a cancelled tool call without the reason, while the fixed-analysis admission in src/server/analysisAdmission.ts (lines 27 to 32) includes it.
  • src/application/native/NativeValueTrace.ts line 76: the loop checkpoint, while the final checkpoint at lines 451 to 456 passes cause: signal.reason.
  • src/application/android/AndroidPackageInspection.ts line 24: the admission guard before input parsing.
  • src/server/registerSessionRecordTools.ts line 128: the import_evidence_bundle checkpoint after the bundle read.

Reproduction

Not executed. Proposed checks from source:

  1. session.withAdmittedAnalysis("binary_overview", AbortSignal.abort(reason), async () => null) on a test session: source predicts AnalysisCancelledError with cause === undefined.
  2. Start session.open(target) against a deferred client, queue withAdmittedAnalysis with a pending signal, then abort with a reason: same prediction.
  3. traceNativeValues(analysis, { procedure: "0x1000" }, AbortSignal.abort(reason)): same prediction.
  4. inspectAndroidPackage(service, input, retention, { signal: AbortSignal.abort(reason) }): same prediction.

Expected behavior

Each checkpoint passes the exact signal.reason as the error cause, as the neighbouring checkpoints in the same owners already do and as #6144 established.

Impact and scope

Bounded diagnostic loss: the typed result reports cancelled with an undefined reason, so callers cannot distinguish cancellation sources or recognize their own reason object. Cancellation classification and cleanup are unaffected. The bundle-import checkpoint is reached only when the abort lands after the read completes; frequency was not measured.

REA version

Source revision 1d896e03b (package metadata 6.7.0).

Runtime and platform

Not applicable; source inspection only.

Target and artifact context

Not applicable.

Interface

MCP

Earliest failure stage

Cleanup, cancellation, or lifecycle

Relevant output or evidence

Source references at 1d896e03b are listed above. For contrast, the same files already pass the reason at src/application/native/NativeValueTrace.ts lines 451 to 456 and src/server/analysisAdmission.ts lines 27 to 32.

NOT_ENOUGH_INFO for runtime output: the proposed checks were not run.

Typed outcome or recovery expected

AnalysisCancelledError whose cause is the identical reason object at every listed site.

Analysis or suspected cause

Source-derived: each site constructs the error with the operation name only. Passing { cause: signal.reason } at the construction site is the established fix; no change to classification, cleanup, or schemas is needed.

Originally created by @viniciusdsandrade on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6958 ## Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ## Area MCP or agent integration ## Observed behavior Source-only finding at main `1d896e03b`; no runtime was executed. After #6143 and #6144, four producing checkpoints still build `AnalysisCancelledError` for an observed abort without the caller's `signal.reason` as the `cause`: - `src/application/binary/BinarySession.ts`: `#waitForTransition` (lines 1452 to 1453 for a pre-aborted signal, line 1460 for the abort listener, lines 1468 and 1476 for a transition that settles while aborted) and the two guards in `withAdmittedExternalMutation` (lines 738 to 739 and 741 to 742). `withAdmittedAnalysis` returns the wait result directly (line 1143), so a session-backed MCP server refuses a cancelled tool call without the reason, while the fixed-analysis admission in `src/server/analysisAdmission.ts` (lines 27 to 32) includes it. - `src/application/native/NativeValueTrace.ts` line 76: the loop checkpoint, while the final checkpoint at lines 451 to 456 passes `cause: signal.reason`. - `src/application/android/AndroidPackageInspection.ts` line 24: the admission guard before input parsing. - `src/server/registerSessionRecordTools.ts` line 128: the `import_evidence_bundle` checkpoint after the bundle read. ## Reproduction Not executed. Proposed checks from source: 1. `session.withAdmittedAnalysis("binary_overview", AbortSignal.abort(reason), async () => null)` on a test session: source predicts `AnalysisCancelledError` with `cause === undefined`. 2. Start `session.open(target)` against a deferred client, queue `withAdmittedAnalysis` with a pending signal, then abort with a reason: same prediction. 3. `traceNativeValues(analysis, { procedure: "0x1000" }, AbortSignal.abort(reason))`: same prediction. 4. `inspectAndroidPackage(service, input, retention, { signal: AbortSignal.abort(reason) })`: same prediction. ## Expected behavior Each checkpoint passes the exact `signal.reason` as the error `cause`, as the neighbouring checkpoints in the same owners already do and as #6144 established. ## Impact and scope Bounded diagnostic loss: the typed result reports `cancelled` with an undefined reason, so callers cannot distinguish cancellation sources or recognize their own reason object. Cancellation classification and cleanup are unaffected. The bundle-import checkpoint is reached only when the abort lands after the read completes; frequency was not measured. ## REA version Source revision 1d896e03b (package metadata 6.7.0). ## Runtime and platform Not applicable; source inspection only. ## Target and artifact context Not applicable. ## Interface MCP ## Earliest failure stage Cleanup, cancellation, or lifecycle ## Relevant output or evidence Source references at 1d896e03b are listed above. For contrast, the same files already pass the reason at `src/application/native/NativeValueTrace.ts` lines 451 to 456 and `src/server/analysisAdmission.ts` lines 27 to 32. NOT_ENOUGH_INFO for runtime output: the proposed checks were not run. ## Typed outcome or recovery expected `AnalysisCancelledError` whose `cause` is the identical reason object at every listed site. ## Analysis or suspected cause Source-derived: each site constructs the error with the operation name only. Passing `{ cause: signal.reason }` at the construction site is the established fix; no change to classification, cleanup, or schemas is needed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4249
No description provided.