FWIW I'm also on macos 15.7.9, zsh 5.9, oh-my-zsh - and I do get this behavior (TIL).
type eg "rg" then up or down arrow, and the history shown is filtered by that rg prefix.
type eg "rg" then up or down arrow, and the history shown is filtered by that rg prefix.