Description
Both AI search endpoints - the standard search route and the context-aware route call a query-sanitizing helper that is never imported into that file. The same helper is correctly imported in the sibling SEO and Community routers; the import line was simply missed here.
Root Cause
The file references a function name that doesn't exist in its scope. The moment either endpoint runs, execution fails before it can do anything useful.
Impact
Every single AI-mode search and every contextual AI request fails immediately, with no exceptions not an edge case, not something that needs specific conditions to trigger. This is one of the three core search modes the product offers, and it is completely inoperable. There's no automated test covering these routes, which explains why it shipped unnoticed.
Proposed Fix
Restore the missing import so the function resolves correctly, matching the pattern already used in the other routers. This should be paired with a regression test that actually exercises both AI endpoints, since the total absence of coverage here is the real root cause of the outage and it's worth checking the other routers for the same class of mistake while addressing it.
Description
Both AI search endpoints - the standard search route and the context-aware route call a query-sanitizing helper that is never imported into that file. The same helper is correctly imported in the sibling SEO and Community routers; the import line was simply missed here.
Root Cause
The file references a function name that doesn't exist in its scope. The moment either endpoint runs, execution fails before it can do anything useful.
Impact
Every single AI-mode search and every contextual AI request fails immediately, with no exceptions not an edge case, not something that needs specific conditions to trigger. This is one of the three core search modes the product offers, and it is completely inoperable. There's no automated test covering these routes, which explains why it shipped unnoticed.
Proposed Fix
Restore the missing import so the function resolves correctly, matching the pattern already used in the other routers. This should be paired with a regression test that actually exercises both AI endpoints, since the total absence of coverage here is the real root cause of the outage and it's worth checking the other routers for the same class of mistake while addressing it.