[P0] Async Future boundary swallows control exceptions from MCP and other runtimes #162
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#162
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?
Failure
The restored aggregate PlUnit suite exposes at least two previously hidden failures:
rlm_mcp_2026_matrix_test:cancellation_control_exception_propagatesreportsno_exception;rlm_mcp_dual_test:time_limit_exception_propagates_through_serverreportsno_exception.The domain runtime does rethrow these control exceptions. They are lost one layer later:
rlm_async:async_execute_task/2catches every worker exception andasync_exception_outcome/3stringifies it into an ordinaryasync_error{kind:exception,...}. Synchronous facades then await the Future and can no longer recover the control exception.Required invariant
The canonical Future boundary must distinguish control-flow exceptions from ordinary failures:
rlm_future_await/[2,3]must rethrow a preserved control exception;async_error{kind:exception,...}results;rlm_future_cancel/2behavior remains the existing structuredkind:cancelledoutcome;Acceptance
time_limit_exceededsurvives submit -> await as the same exception;rlm_cancelled(Token)survives submit -> await;Discovered during false-green remediation after #60.
Completed on current main
ab426de54a54101ca3a6d8197db77e4c1f9d009f. Acceptance evidence: time-limit and RLM cancellation control exceptions survive submit/await and are rethrown; ordinary exceptions remain structured; explicit future cancellation and canonical async ownership pass; MCP time-limit/cancellation propagation passes. Focused gate 48/48; fresh aggregate 74 suites and 767/767, with 0 failures/timeouts/blocked/fixme. PR #163 was closed as superseded because its stale head would remove newer mainline work.