Skip to content

fix(search): name unified search tools after the provider id - #265

Open
vlfesko wants to merge 1 commit into
nextcloud:mainfrom
vlfesko:fix/search-tool-names-by-provider-id
Open

vlfesko wants to merge 1 commit into
nextcloud:mainfrom
vlfesko:fix/search-tool-names-by-provider-id

Conversation

@vlfesko

@vlfesko vlfesko commented Oct 13, 2026 •

Copy link
Copy Markdown

Problem

ex_app/lib/all_tools/search.py names each unified search tool after the provider's display name, which Nextcloud translates into the user's language, and then replaces every character outside [A-Za-z0-9_-] with _.

For languages in a non-Latin script the names collapse into one. With a Ukrainian user, 21 of 24 providers on our instance became the same tool, search__. The model then called the wrong provider (e.g. search__ with {"type": "deck-board"} while looking for text in files), or none at all, and answered that nothing was found. In English the names stay distinct, so the problem does not show up there.

(#125 fixed whitespace in the same names; this is the same function, the non-ASCII case.)

Change

  • The tool name is built from provider['id'] (stable, ASCII, unique) instead of provider['name'], e.g. search_fulltextsearch, search_files.
  • The description keeps the translated display name and adds the id: Searches Контекстний пошук (search provider 'fulltextsearch') in Nextcloud. Without the id, a translated name such as "Контекстний пошук" says little to the model about what the provider searches.

Testing

Running 2.9.1 with this change on our Nextcloud 35 instance (vLLM, Mistral Small) with a Ukrainian user: all 24 providers get distinct tool names, and a request for a phrase inside the user's documents now reaches the full-text search tool (in 3 of 4 runs; the 4th picked the file-name search) instead of the collapsed search__.

Each unified search tool was named after the provider's display name,
which is translated into the user's language, with every character
outside [A-Za-z0-9_-] replaced. For languages written in a non-Latin
script the names collapse: in Ukrainian 21 of 24 providers became the
same tool, `search__`, so the model called the wrong provider or none.

Name the tool after the provider id, which is stable and ASCII, and
mention the id in the tool's description as well, so the model can tell
e.g. the full-text provider from the file name search even when the
display name says little about it.

Signed-off-by: Volodymyr Fesko <vladimir.fesko@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant