getting rid of small annoyances

This commit is contained in:
Simon Martens
2026-01-11 11:38:31 +01:00
parent a2ecd125ab
commit 6175e9c99a
5 changed files with 43 additions and 24 deletions

View File

@@ -45,16 +45,12 @@ func (p *AgentsAPI) searchHandler(app core.App) HandleFunc {
query := strings.TrimSpace(e.Request.URL.Query().Get("q"))
limit := parseAgentsLimit(e.Request.URL.Query().Get("limit"))
results, err := dbmodels.FTS5SearchAgents(app, query)
results, err := dbmodels.TitleSearchAgents(app, query)
if err != nil {
primary, alt, err := dbmodels.BasicSearchAgents(app, query)
if err != nil {
app.Logger().Error("agent search failed", "query", query, "limit", limit, "error", err)
return e.JSON(http.StatusInternalServerError, map[string]any{
"error": "failed to search agents",
})
}
results = append(primary, alt...)
app.Logger().Error("agent search failed", "query", query, "limit", limit, "error", err)
return e.JSON(http.StatusInternalServerError, map[string]any{
"error": "failed to search agents",
})
}
seen := map[string]bool{}