You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@answer.apache.org by "lb1038678031 (via GitHub)" <gi...@apache.org> on 2026/08/28 00:25:21 UTC

[PR] fix(ai): stop advertising semantic_search when no vector search plugin is enabled [answer]

lb1038678031 opened a new pull request, #1597:
URL: https://github.com/apache/answer/pull/1597

   Fixes #1532.
   
   ### Problem
   
   The `semantic_search` MCP tool was always advertised to the model, even when
   no VectorSearch plugin was enabled. The model could select it, the call
   reached `EmbeddingService.SearchSimilar`, and every such conversation logged
   `semantic search failed: semantic search is not available: no vector search
   plugin is enabled` — polluting logs and wasting a tool-call round trip on a
   capability that does not exist in the deployment.
   
   ### Fix
   
   - `EmbeddingService.Available()` reports whether a VectorSearch plugin is
     currently enabled.
   - `MCPController.SemanticSearchAvailable()` exposes that to the AI chat.
   - `getMCPTools()` omits the `semantic_search` tool when unavailable; all
     other MCP tools keep working exactly as before.
   - The default AI prompts (zh/en, and admin-custom prompts) drop the
     `semantic_search` instruction lines in the same situation, so the model is
     no longer nudged toward a missing capability.
   
   ### Testing
   
   - New unit tests: tool advertisement with/without the capability, prompt-line
     stripping, and prompt adaptation (`internal/controller/ai_tools_test.go`).
   - `go test ./internal/controller/` — all pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org


Re: [PR] fix(ai): stop advertising semantic_search when no vector search plugin is enabled [answer]

Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on PR #1597:
URL: https://github.com/apache/answer/pull/1597#issuecomment-5449465046

   Thank you, @lb1038678031, for this thoughtful and well-tested fix! It not only prevents the unavailable tool from being advertised, but also keeps the prompts aligned with the deployment capabilities. Much appreciated!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org


Re: [PR] fix(ai): stop advertising semantic_search when no vector search plugin is enabled [answer]

Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars merged PR #1597:
URL: https://github.com/apache/answer/pull/1597


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org