agent-native icon indicating copy to clipboard operation
agent-native copied to clipboard

[Slides] Let image search use a configurable Custom Search address

Open Specstreamai opened this issue 3 weeks ago • 1 comments

Slides image search sends every request to GOOGLE_IMAGE_SEARCH_URL, a constant set to https://www.googleapis.com/customsearch/v1 in templates/slides/server/lib/media-search-providers.ts:3. Only GOOGLE_API_KEY and GOOGLE_SEARCH_CX come from settings.

Google's overview page says "Existing Custom Search JSON API customers have until January 1, 2027 to transition to an alternative solution" (https://developers.google.com/custom-search/v1/overview). After that date image search in Slides stops for everyone who set it up, and there is no setting that changes where the request goes.

I'd like to add one optional setting, GOOGLE_SEARCH_URL, resolved the same way as the other two:

const [apiKey, searchEngineId, searchUrl] = await Promise.all([
  runtime.resolveSecret("GOOGLE_API_KEY"),
  runtime.resolveSecret("GOOGLE_SEARCH_CX"),
  runtime.resolveSecret("GOOGLE_SEARCH_URL"),
]);
// ...
const response = await runtime.fetch(
  `${searchUrl || GOOGLE_IMAGE_SEARCH_URL}?${params}`,
  fetchOptions(),
);

It would be registered in server/register-secrets.ts with required: false like GOOGLE_SEARCH_CX, listed commented out in .env.example, and covered in media-search-providers.test.ts with one case that the request goes to Google when it isn't set and one that it goes to the configured address when it is. With nothing set the request is the same as today.

Since CONTRIBUTING asks for an issue before a new config option, I wanted to check the shape first. I can send it as a PR if this works for you.

Specstreamai avatar Nov 13 '26 05:11 Specstreamai

Thanks for flagging the upcoming change. A maintainer will review the replacement search-provider approach and its security requirements before implementation.

builder-factory avatar Nov 13 '26 22:11 builder-factory