How can a CommandGroup access the .modelContext environment?

I'm trying to use @Query in a wrapper view around a Button to keep a macOS menu command up to date but I keep getting

Set a .modelContext in view's environment to use Query

even though

@Environment(\.modelContext) private var modelContext

is part of the views.

How can a CommandGroup access the .modelContext environment?
 
 
Q