LongRunningIntent run from in the app?

If I attempt to use a LongRunningIntent from a SwiftUI Button, using the Button(_:AppIntent:) control, I get the following errors:

[LongRunningIntent <<E:<unknown>>>] No IntentContext available
performBackgroundTask threw: noContext
Intent failed to execute with error: LNPerformActionErrorCodeUnsupportedValueType

It runs as expected when run from the Shortcuts app, but fails when run from a button within the app.

Feedback ID (with sample app): FB23492034

I think LongRunningIntent is designed to run in the background. When your app is foregrounded, it can't run tasks that require your app to be in the background. I'd be interested if this works if you call the intent from a widget using that same type of button.

LongRunningIntent run from in the app?
 
 
Q