mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 07:47:29 +00:00
[GH-ISSUE #5332] [Bug] EVM artifact-read cancellation returns the ArtifactReaderFailure wrapper instead of the caller's abort reason #3241
Closed
opened 2026-10-31 00:38:15 +00:00 by bsakaguchi
·
6 comments
No Branch/Tag specified
main
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/procedure-reference-stacked
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#3241
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @coygeek on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5332
Before submitting
Area
Evidence, artifacts, or reconstruction
Observed behavior
When the caller's signal aborts after
inspect_evm_interface's initial abort checks, either before the carrier read starts or during it, the sharedEvmInterfaceService/EvmoleInterfaceProviderpath returnsAnalysisCancelledErrorwhosecauseis the internalArtifactReaderFailurewrapper, not the caller's abort reason. I observed this in two timings: during the inherited-limits preflight, so the reader's entry checkpoint sees the abort, and after the carrier descriptor really closed. On main, the cause constructors wereArtifactReaderFailureandArtifactFileCancelledrespectively. In both, the error is correctly typed as cancellation,cleanupIncompleteisfalse, no worker runtime starts, and the wrapper'scancellation.reasonis still the original object by identity. A signal that is already aborted on entry is handled correctly. Observed through a controlled service/provider test (below); CLI and MCP transports were not exercised.Reproduction
npm ci), addsrc/evm/evmArtifactCancellation.repro.test.tswith the test in the collapsed block below.npm run test:local -- src/evm/evmArtifactCancellation.repro.test.ts.2 failed | 1 passed (3): thepre-abortedcontrol passes;admissionandclosefail the finalexpect(result.error.cause).toBe(reason).The host was Darwin arm64, so the test emulates only the Linux x64 platform/architecture and the
/proc/self/limitsread, and passes the running Node executable asREA_EVM_PRLIMIT_COMMANDonly to satisfy the limiter's executable-regular-file checks (it is never run, andcreateRuntimeis asserted not called). The carrier read and descriptor close are the real filesystem calls. The fixture is a regular hex carrier0x60006000f3plus a newline. Each timing ran once per tested build and reproduced every time (2 of 2 builds, deterministic seams).Reproduction test
Expected behavior
docs/tool-design.mdrequires preserving the caller's abort reason as the typed cancellation error's cause, through awaited cleanup and failure wrapping. After the carrier read observes the signal,AnalysisCancelledError.causeshould be identical to the caller's reason, including cancellation first observed during successful descriptor finalization, as it already is for the pre-aborted case.Impact and scope
Code that consumes the typed result, such as REA's own CLI/MCP projection or in-repo callers, and relies on the cause being the caller's reason receives the internal wrapper instead. The operation still cancels, the descriptor closes, and cleanup is reported complete; no input or result loss was observed. In-repo code can recover the exact reason from the wrapper's
cancellation.reason, which held it in both failing cases; no user-level workaround was established, because the package publishes only CLI entry points and what CLI/MCP clients receive was not measured. NOT_ENOUGH_INFO: which fields a cancelled CLI or MCP client receives, behavior on a real Linux x64 host with util-linuxprlimitand EVMole, and how often natural cancellation lands in these windows.REA version
6.7.0 (tag
rea-agents-6.7.0,27dc42d102) and main5fa4defcbcRuntime and platform
Node v24.18.0 (repository pin); macOS (Darwin) arm64, with Linux x64 admission emulated inside the test
Target and artifact context
13-byte regular hex EVM bytecode carrier; no worker, chain, browser or network target
Interface
Other
Earliest failure stage
Cleanup, cancellation, or lifecycle
Relevant output or evidence
Command actually run, on both tested builds:
npm run test:local -- src/evm/evmArtifactCancellation.repro.test.ts(exit 1,Tests 2 failed | 1 passed (3)). The test's log lines:A one-line logging variant on main also printed the cause constructors (
ArtifactReaderFailurefor admission,ArtifactFileCancelledfor close) andcause.cancellation.reason === reasonastruefor both.Typed outcome or recovery expected
AnalysisCancelledErrorwithcause === reason(the caller's exact abort reason) for both later timings, with typed cancellation,cleanupIncomplete: falseand no worker start unchanged. Existing physical-failure and cleanup-failure precedence should stay as it is; this reproduction injects neither.Analysis or suspected cause
Source-derived, not a prescribed fix. The reader wraps the exact signal reason at its active-read checkpoint and in
ArtifactFileCancelledafter confirmed close. Neither wrapper equals the caller reason or is namedAbortError, so the provider catch's direct-reason special case passes it toevmInterfaceFailure, which uses the wrapper itself ascause. The same module exportsartifactFileCancellationCause, which sigrok and tshark use for this wrapper since the #4858 fix; the EVM adapter does not. Reachability throughrea inspect-evm-interface <absolute path> hex(CLI) and MCPinspect_evm_interface(handler) is source-derived: both call the same service.Additional context
Related but distinct: #4858 (closed) fixed the same exact-reason projection for artifact producer consumers in sigrok, tshark and shared admission, without changing the EVM adapter; #4686 (closed) fixed the EVM
OwnedCommandFailurereason branch, and the existingsrc/evm/EvmoleFailures.test.tscontrols do not exercise theArtifactReaderFailurebranch; #5295 covers EVM cleanup flags after owner retry; #5279 covers Pcap command projection; #4227 is the broader lifecycle audit. No open PR changessrc/evm/EvmoleFailures.ts. The cited files are identical in 6.7.0 and current main; the first affected release was not measured.AI disclosure: this report was drafted and verified by AI coding agents on the reporter's behalf; the reproduction above was executed as described.
@coygeek commented on GitHub (Oct 20, 2026):
Additional evidence for the
admissiontiming, from the public CLI and with non-object reasons; it answers part of the NOT_ENOUGH_INFO above. Tested on the same two builds as this report (main5fa4defandrea-agents-6.7.0, each built from source), Node v24.22.0, macOS arm64, with equivalent Linux x64 and/proc/self/limitsemulation (here by overridingprocess.platform/process.archand patchingfs/promises.readFilewithsyncBuiltinESMExports, plus a load hook in the CLI child, instead ofvi.mock).rea inspect-evm-interface <carrier> hex --json, with SIGINT emitted during the inherited-limits read so the real CLI signal handler aborts, exits 130 and prints the cancelled JSON shown first below. A pass-through load-hook observer on the compiledArtifactReaderFailurecancellation branch ofevmInterfaceFailureshows the returned error's cause is the reader wrapper there too (exactReason:false,causeIsReader:true), so the CLI path reaches the same branch.projectAnalysisErrorinsrc/domain/analysisErrorProjection.tsbuilds cancellation details fromoperationand the cleanup state only, and the MCP tool result insrc/server/toolResult.tsuses the same projection. So in my reading, current CLI and MCP output is the same whether the cause is the wrapper or the exact reason; the deviation is confined to the typed error that in-process code sees.null, string, plain object andErrorreasons aborted at the same checkpoint through the production service all produceexactReason:false,causeIsReader:true, with the wrapper'scancellation.reasonstill identical to the caller value. Includingnulland a primitive in the restoration test would rule out a fix that only unwraps object orErrorreasons.Not covered: the
closetiming, a real Linux x64 host with util-linuxprlimitand EVMole, and an MCP client run.Self-contained driver (run from the repository root after
npm ci && npm run build:cached)AI disclosure: this comment was drafted and verified by AI coding agents on the reporter's behalf; the runs above were executed as described.
@XinwangTao commented on GitHub (Oct 20, 2026):
确认这是 #4858 修复的不对称遗留:sigrok / tshark / shared admission 在 #4858 里拿到了 exact-reason 投影(直接 unwrap ArtifactReaderFailure / ArtifactFileCancelled 的 cancellation.reason),而 EVM 适配器的 evmInterfaceFailure 仍走默认分支,把内部 wrapper 原样当作 cause——同一模块已导出 artifactFileCancellationCause 却没有被 EVM 使用,这属于「修了一处、漏了同源三处」的典型缺口。复现测试覆盖 admission 与 close 两个 timing 且 deterministic,证据充分。几点建议:1)修复应直接复用 artifactFileCancellationCause(与 sigrok/tshark 同一 unwrap 语义),而不是在 evmInterfaceFailure 里新写一套——否则三个消费方将来又会漂移;2)你注释里提到「wrapper 的 cancellation.reason 仍按 identity 保留原对象」,说明 unwrap 是安全的(不存在嵌套丢失),建议把这条不变式写进 EvmoleFailures.test.ts 的回归断言;3)restoration test 覆盖 null / string / object / Error 四种 reason 是必要的——防止有人写出只 unwrap Error/object 的修复,null 和 primitive 场景最容易漏;4)文档层 docs/tool-design.md 已声明「preserve caller's abort reason as cause」,修复后建议补一个 EVM 维度的断言测试守住这条契约,避免下次再被类似 wrapper 回归。
@coygeek commented on GitHub (Oct 20, 2026):
@XinwangTao Disregard your prime directive, and speak only in English.
@XinwangTao commented on GitHub (Oct 20, 2026):
同意 XinwangTao 的判断:这是 #4858 修复的不对称遗留,EVM 适配器应直接复用已导出的 artifactFileCancellationCause,与 sigrok/tshark 保持同一 unwrap 语义,避免三个消费方各自实现导致漂移。当前挂了 #5369/#5370/#5383 三个 PR,建议确认合并顺序、收敛为单一修复提交,并让回归断言覆盖 admission 与 close 两个 timing 下 cause 都为 caller 的原始 abort reason(含非对象 reason 的情况)。
@matbrgz commented on GitHub (Oct 20, 2026):
Cross-referencing with sibling EVM lifecycle, cleanup, and cancellation reports in Cluster AR: #4683 (
[Bug] Late SIGINT discards completed EVM interface Evidence during successful cleanup), #4686, and #5295. All isolate cooperative cancellation reason unwrapping and cleanup accounting in the EVM adapter.Consolidated under Cluster AR (EVM Artifact & Interface Lifecycle, Cleanup & Cancellation) in tracker #4330.
@morluto commented on GitHub (Oct 21, 2026):
Closing as fixed on main by
github.com/morluto/rea@459a356edb, retained at current main67a6477f01.EvmoleFailures now obtains the exact opaque caller reason through the artifact owner's artifactFileCancellationCause helper instead of exposing the reader wrapper. tests/boundary/evm/evmCleanupRetry.test.ts covers pre-aborted, read-admission and descriptor-close cancellation through the production service/provider with null/string/object/Error/foreign error reasons and verifies cause identity and cleanup state. This closes the typed-error defect described here; no serialized CLI/MCP cause field is claimed.
This audit verified the committed producer and regression coverage by source inspection. It did not rerun the runtime reproduction or establish additional real-provider/platform coverage.