System search AssistantIntent not working

@available(iOS 18.0, *)
@AssistantIntent(schema: .system.search)
struct SearchIntent: AppIntent {
  static let title: LocalizedStringResource = "Search <app name redacted>"
  static let searchScopes: [StringSearchScope] = [.general]

  @Parameter(title: "Criteria")
  var criteria: StringSearchCriteria

  @MainActor
  func perform() async throws -> some IntentResult {
    MyDependencyManager.shared.performSearch(with: criteria.term)
    return .result()
  }
}

// In AppShortcutProvider

AppShortcut(
  intent: SearchIntent(),
  phrases: [
   "Find \(\.$criteria) in \(.applicationName)",
    "Search for \(\.$criteria) in \(.applicationName)",
  ],
  shortTitle: "Search <app name redacted>",
  systemImageName: "magnifyingglass"
)

The search works when using the Shortcuts app, but not when using Siri. For example if I ask Siri "Search for <thing> in <app name>" it just does a Google search or prompts me to install the app from the App Store (I am running a debug build via Xcode). I can't get this to work from Spotlight either.

I am using Xcode 16 and running the app on an iPhone 16 with OS 18.2 beta and Apple Intelligence turned on.

What am I doing wrong here? I cannot find any other information about this intent or how to properly set it up and use it.

I don't think this is live in Siri yet... at least they haven't announced it and none of the other features in the 'personal context' category have shipped. Apple hasn't said when - rumors say 18.3 or 18.4 (i.e. 2025).

I like to use the Shortcuts app for testing. If you add your intent to a new shortcut and then pass a search term into your intent through the shortcut, what happens? If that much works, then you're on the right path. If that doesn't work, review the documentation article on the search domain to make sure you haven't forgotten something in your implementation.

— Ed Ford,  DTS Engineer

@DTS Engineer

It works using the Shortcuts app as I mentioned in my post.

In iOS 18.2 beta 2 & 3 I see new behaviour - it seems like the system is trying to load my intent when I use Siri (i.e. I see a loading animation on my text prompt “Search for <query> in <app name>”, previously it would simply open web search results) but it shows that loading animation for a few seconds and then simply fails and says ”Something went wrong”. In the debug logs in Xcode, I see:

No ConnectionContext found for 12933943520

Identifier rank 4 should have been less than 4.

If I remove this intent from my shortcuts provider, Siri reverts back to showing me web search results.

I am not sure whether this intent needs to be in the shortcuts provider or not?

System search AssistantIntent not working
 
 
Q