fix: dynamic-code wrapper no longer drops cancellation on a sync Execute path - #1744
Conversation
The runtime always invokes ExecuteAsync with the real combined token, so the sync wrapper only discarded cancellation via ExecuteAsync(..., default). Delete that landmine and assert the generated source stays async-only. Co-authored-by: Cursor <cursoragent@cursor.com>
|
LGTM (reviewer: Fable). Matches the agreed Option A design: the unused sync Execute() wrapper (which discarded the runtime token via ExecuteAsync(parameters, default) and added a sync-over-async landmine) is removed from the template, with a clear why-not comment left in place. The string-level EditMode test asserts both the presence of the ct-taking ExecuteAsync and the absence of the sync path without any compile-and-run E2E, and CommandRunner.Execute stays untouched per the dead-code policy (recorded as an umbrella-note candidate). |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesAsync wrapper API
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
4506a7c
into
feature/dynamic-code-cancellation-hardening
Summary
execute-dynamic-codesnippets no longer generate an unused syncExecute()that calledExecuteAsync(..., default)and discarded the runtime cancellation token.ExecuteAsyncwith the combined token.User Impact
ExecuteAsync(..., ct)is generated. Cooperative cancellation on the real runtime path is unchanged and no longer shadowed by a dead sync landmine.Changes
Execute()fromWrapperTemplate(design option A; runtime never called it).public object Execute(/ExecuteAsync(parameters, default)/GetAwaiter().GetResult()in generated source (no compile-and-run E2E).Execute()found.CommandRunner.Execute(ExecutionContext)— recorded for umbrella notes, not deleted here.Refs
2026-07-13_uloopハング可能性の全数調査結果.md§3 PR 3-1/tmp/claude-shared/pr-3-1-design.mdVerification
uloop compile(0/0)WrapperTemplateTests.Build_ShouldGenerateExecuteAsyncWithCancellationTokenAndOmitSyncExecuteMade with Cursor