Ported from #2451. Co-authored-by: ss <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]>