[GH-ISSUE #4634] [Bug] Cutter command descriptor failures identify discovery instead of command #2413

Closed
opened 2026-10-17 21:04:20 +00:00 by bsakaguchi · 2 comments
Owner

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

Before submitting

  • Searched open and closed Cutter descriptor/operation/cancellation and abort-reason reports. #4607 concerns status replies; #4471 concerns descriptor admission/cleanup, rather than these request identities.
  • No credentials or private target data included.

Area

Native analysis or decompilation

Observed behavior

A command or completion confirmation that cannot close its selected descriptor reports cleanup_incomplete with details.operation: "list_cutter_sessions". Both operations are serving cutter_command. This was observed with actual opened descriptors and a controlled close rejection, before any bridge connection or command dispatch.

Reproduction

In tests/process-global/cutterDescriptorLifetime.test.ts, create one valid private descriptor. Wrap its actual FileHandle.close so it rejects until released. Call either client.execute({sessionId,expectedGeneration:0,command:'ij',json:false}) or client.confirmCommandCompletion(sessionId,requestId). Project the returned/thrown AnalysisError. Both new controls failed on unchanged main: the code is cleanup_incomplete but the operation is list_cutter_sessions.

Executed: npm run test:focused -- tests/boundary/providers/CutterCommandCancellation.test.ts tests/process-global/cutterDescriptorLifetime.test.ts; four new controls failed and seven existing controls passed. Two failures concern this report; the other two are a separate opaque-reason finding.

Expected behavior

Retain the caller operation, exact failed descriptor owner, and retry semantics. Genuine discovery should continue to identify list_cutter_sessions. The selected-operation contract is described in docs/mcp-contracts.md; adjacent #4607 and #4614 establish the same attribution rule at different producers.

Impact and scope

P2: machine-readable consumers misattribute the request while descriptor cleanup remains incomplete. Two deterministic fault controls reproduced once each. No leak, data loss, native-engine occurrence frequency or downstream incident established. NOT_ENOUGH_INFO: public transport reproduction and spontaneous OS close failures.

Target and artifact context

One synthetic private Cutter descriptor, read through a real file handle with an injected close fault. No binary or live bridge is needed.

REA version

6.5.0; main 5c0472c571. Only new regression files were changed during reproduction; production source was unchanged.

Runtime and platform

Node 24.18.0, Darwin arm64. No native Cutter engine or target execution.

Interface

Other: production client/service boundary; no public CLI/MCP reproduction claimed for this report.

Earliest failure stage

Cleanup, cancellation, or lifecycle

Relevant output or evidence

Both command and completion controls expected details.operation=cutter_command and received list_cutter_sessions, with code=cleanup_incomplete. Source: src/cutter/CutterBridgeClient.ts #readDescriptors always calls descriptorFailure(cause, "list_cutter_sessions"), including when #find serves a command. Original descriptor cleanup ownership is otherwise retained.

Typed outcome or recovery expected

Pass the accepted operation to the descriptor failure owner. Verify failed retry, successful exact-descriptor release, command and completion attribution, and unchanged discovery attribution.

Analysis or suspected cause

Source-derived: the shared acquisition boundary hard-codes its discovery consumer's operation instead of retaining the requesting operation.

Additional context

Found while auditing the consumers around #4607 after its fix. Real native Cutter incidence remains unknown.

Originally created by @morluto on GitHub (Oct 17, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4634 ### Before submitting - [x] Searched open and closed Cutter descriptor/operation/cancellation and abort-reason reports. #4607 concerns status replies; #4471 concerns descriptor admission/cleanup, rather than these request identities. - [x] No credentials or private target data included. ### Area Native analysis or decompilation ### Observed behavior A command or completion confirmation that cannot close its selected descriptor reports `cleanup_incomplete` with `details.operation: "list_cutter_sessions"`. Both operations are serving `cutter_command`. This was observed with actual opened descriptors and a controlled close rejection, before any bridge connection or command dispatch. ### Reproduction In tests/process-global/cutterDescriptorLifetime.test.ts, create one valid private descriptor. Wrap its actual FileHandle.close so it rejects until released. Call either client.execute({sessionId,expectedGeneration:0,command:'ij',json:false}) or client.confirmCommandCompletion(sessionId,requestId). Project the returned/thrown AnalysisError. Both new controls failed on unchanged main: the code is cleanup_incomplete but the operation is list_cutter_sessions. Executed: `npm run test:focused -- tests/boundary/providers/CutterCommandCancellation.test.ts tests/process-global/cutterDescriptorLifetime.test.ts`; four new controls failed and seven existing controls passed. Two failures concern this report; the other two are a separate opaque-reason finding. ### Expected behavior Retain the caller operation, exact failed descriptor owner, and retry semantics. Genuine discovery should continue to identify list_cutter_sessions. The selected-operation contract is described in docs/mcp-contracts.md; adjacent #4607 and #4614 establish the same attribution rule at different producers. ### Impact and scope P2: machine-readable consumers misattribute the request while descriptor cleanup remains incomplete. Two deterministic fault controls reproduced once each. No leak, data loss, native-engine occurrence frequency or downstream incident established. NOT_ENOUGH_INFO: public transport reproduction and spontaneous OS close failures. ### Target and artifact context One synthetic private Cutter descriptor, read through a real file handle with an injected close fault. No binary or live bridge is needed. ### REA version 6.5.0; main 5c0472c571cd27a812013650624893aefa446209. Only new regression files were changed during reproduction; production source was unchanged. ### Runtime and platform Node 24.18.0, Darwin arm64. No native Cutter engine or target execution. ### Interface Other: production client/service boundary; no public CLI/MCP reproduction claimed for this report. ### Earliest failure stage Cleanup, cancellation, or lifecycle ### Relevant output or evidence Both command and completion controls expected details.operation=cutter_command and received list_cutter_sessions, with code=cleanup_incomplete. Source: src/cutter/CutterBridgeClient.ts #readDescriptors always calls descriptorFailure(cause, "list_cutter_sessions"), including when #find serves a command. Original descriptor cleanup ownership is otherwise retained. ### Typed outcome or recovery expected Pass the accepted operation to the descriptor failure owner. Verify failed retry, successful exact-descriptor release, command and completion attribution, and unchanged discovery attribution. ### Analysis or suspected cause Source-derived: the shared acquisition boundary hard-codes its discovery consumer's operation instead of retaining the requesting operation. ### Additional context Found while auditing the consumers around #4607 after its fix. Real native Cutter incidence remains unknown.
Author
Owner

@morluto commented on GitHub (Oct 17, 2026):

Implemented and pushed to main in two separate commits:

  • #4634: 199396f61c passes the requesting operation into the descriptor failure owner. Discovery retains list_cutter_sessions; command execution and completion confirmation retain cutter_command, without changing exact cleanup dependencies.
  • #4635: 71929ed37c normalizes all three command checkpoints into AnalysisCancelledError with the exact opaque reason as cause. The service still preserves independent typed producer errors; it does not guess from reason equality.

Validation executed:

  • Before repair, four new controls failed on unchanged main (two descriptor operation controls, two typed opaque-reason admission races); seven existing controls passed.
  • The descriptor commit passed 61 focused tests across five files. The completed batch passed 72 tests across nine files, including denied and successful exact-descriptor retry, original discovery behavior, actual client/service admission races, same-object physical-error controls, pre-aborted direct-client behavior, capacity, CLI status proof, MCP cancellation and cleanup recovery.
  • Typecheck/lint, docs checks, five documentation conformance controls, normal commit hooks and normal pre-push checks passed. Source review found no blocker. The direct-client assertion now requires typed cancellation and the exact original AbortError as cause.

Bounded completed-task comparison against main 5c0472c57: two alternating warm repeats per build, plus separately recorded first processes. Cancellation at admission: baseline/candidate elapsed 0.08803/0.08755 seconds, CPU 0.07983/0.08056 seconds, sampled peak process-family RSS 60,456,960/60,588,032 bytes, raw projected-error tokens 44/55 (cl100k_base). Descriptor read, denied close, denied retry and successful exact release: elapsed 0.08734/0.08723 seconds, CPU 0.08319/0.08119 seconds, RSS 60,637,184/60,743,680 bytes, median tokens 147.5/147; per-run resource paths vary. No speed, memory or token reduction claimed. True cold, whole-agent, CLI/MCP/catalog/request/retry transport and native-engine costs remain unmeasured.

Scope: descriptor controls use real file handles with controlled close faults; cancellation races use the actual client/service and an empty private directory. Same-object physical controls use a controlled provider port. Existing public CLI/MCP regressions passed; the new defects were reproduced at the production provider boundary, not through public transport or a native Cutter engine. No native-engine verification or support claim added. Heavy Qodo/profiler jobs were not restarted.

<!-- gh-comment-id:6227930042 --> @morluto commented on GitHub (Oct 17, 2026): Implemented and pushed to main in two separate commits: - #4634: 199396f61c8f61da326d059606a992304a760147 passes the requesting operation into the descriptor failure owner. Discovery retains list_cutter_sessions; command execution and completion confirmation retain cutter_command, without changing exact cleanup dependencies. - #4635: 71929ed37cdc560b6b8aa62b5f7182e417c8a850 normalizes all three command checkpoints into AnalysisCancelledError with the exact opaque reason as cause. The service still preserves independent typed producer errors; it does not guess from reason equality. Validation executed: - Before repair, four new controls failed on unchanged main (two descriptor operation controls, two typed opaque-reason admission races); seven existing controls passed. - The descriptor commit passed 61 focused tests across five files. The completed batch passed 72 tests across nine files, including denied and successful exact-descriptor retry, original discovery behavior, actual client/service admission races, same-object physical-error controls, pre-aborted direct-client behavior, capacity, CLI status proof, MCP cancellation and cleanup recovery. - Typecheck/lint, docs checks, five documentation conformance controls, normal commit hooks and normal pre-push checks passed. Source review found no blocker. The direct-client assertion now requires typed cancellation and the exact original AbortError as cause. Bounded completed-task comparison against main 5c0472c57: two alternating warm repeats per build, plus separately recorded first processes. Cancellation at admission: baseline/candidate elapsed 0.08803/0.08755 seconds, CPU 0.07983/0.08056 seconds, sampled peak process-family RSS 60,456,960/60,588,032 bytes, raw projected-error tokens 44/55 (cl100k_base). Descriptor read, denied close, denied retry and successful exact release: elapsed 0.08734/0.08723 seconds, CPU 0.08319/0.08119 seconds, RSS 60,637,184/60,743,680 bytes, median tokens 147.5/147; per-run resource paths vary. No speed, memory or token reduction claimed. True cold, whole-agent, CLI/MCP/catalog/request/retry transport and native-engine costs remain unmeasured. Scope: descriptor controls use real file handles with controlled close faults; cancellation races use the actual client/service and an empty private directory. Same-object physical controls use a controlled provider port. Existing public CLI/MCP regressions passed; the new defects were reproduced at the production provider boundary, not through public transport or a native Cutter engine. No native-engine verification or support claim added. Heavy Qodo/profiler jobs were not restarted.
Author
Owner

@morluto commented on GitHub (Oct 18, 2026):

Closing as fixed on main after reconciling this report with the landed owner/consumer changes.

  • 199396f61: fix(cutter): retain command attribution through descriptor cleanup. Validated 61 focused tests across five files, including denied retry and successful native descriptor release. Controlled close faults; no native Cutter engine verified.

Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.

<!-- gh-comment-id:6255996347 --> @morluto commented on GitHub (Oct 18, 2026): <!-- rea-backlog-reconciliation-2026-10-19-4634 --> Closing as fixed on `main` after reconciling this report with the landed owner/consumer changes. - [199396f61](https://github.com/morluto/rea/commit/199396f61c8f61da326d059606a992304a760147): fix(cutter): retain command attribution through descriptor cleanup. Validated 61 focused tests across five files, including denied retry and successful native descriptor release. Controlled close faults; no native Cutter engine verified. Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.
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#2413
No description provided.