[PR #30] [MERGED] Search Fixes #220

Closed
opened 2026-02-15 17:16:21 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/30
Author: @aaronn
Created: 1/24/2026
Status: Merged
Merged: 1/24/2026
Merged by: @steipete

Base: mainHead: bugfix/search-round-2


📝 Commits (4)

📊 Changes

4 files changed (+26 additions, -9 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 convex/httpApi.handlers.test.ts (+17 -4)
📝 convex/httpApi.ts (+2 -1)
📝 convex/search.ts (+6 -4)

📄 Description

Found two more bugs that might be the cause:

First Bug: Convex vectorSearch limit exceeded

Convex's vectorSearch API has a hard maximum of 256 for the limit parameter. The old code computed:

  • maxCandidate = Math.min(Math.max(limit * 10, 200), 1000) → up to 1000
  • candidateLimit = Math.max(limit * 3, 50) → starts at 150 with your pageSize of 50

When the first iteration (150 candidates) didn't find enough exact token matches, it doubled to 300, which exceeds 256 and causes ctx.vectorSearch to throw a validation error. Since this
isn't wrapped in a try/catch, it crashes the action.

Fix (convex/search.ts): Cap both values at 256:

  • maxCandidate = Math.min(Math.max(limit * 4, 64), 256)
  • candidateLimit = Math.min(Math.max(limit * 2, 32), 256)

Second Bug: Wrong parameter name in HTTP API

convex/httpApi.ts was passing approvedOnly to searchSkills, but the action only accepts highlightedOnly. This would cause a Convex argument validation error for any HTTP API search
calls.

Fix: Changed approvedOnly: to highlightedOnly: in the runAction call.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/30 **Author:** [@aaronn](https://github.com/aaronn) **Created:** 1/24/2026 **Status:** ✅ Merged **Merged:** 1/24/2026 **Merged by:** [@steipete](https://github.com/steipete) **Base:** `main` ← **Head:** `bugfix/search-round-2` --- ### 📝 Commits (4) - [`9a0b816`](https://github.com/openclaw/clawhub/commit/9a0b8164b0426c60fb676cb794c7817694254ac7) more search fixes - [`e7bf035`](https://github.com/openclaw/clawhub/commit/e7bf03570a60fa96baa267589f8f85d59ff227a1) update tests - [`1065df1`](https://github.com/openclaw/clawhub/commit/1065df1877058a813497f1eea4ff2374a198a49d) comments - [`bf56fae`](https://github.com/openclaw/clawhub/commit/bf56fae6b85b97b3c309d06edd1ff3cceb926e8f) fix: tune search filters and limits (#30) (thanks @aaronn) ### 📊 Changes **4 files changed** (+26 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `convex/httpApi.handlers.test.ts` (+17 -4) 📝 `convex/httpApi.ts` (+2 -1) 📝 `convex/search.ts` (+6 -4) </details> ### 📄 Description Found two more bugs that might be the cause: ## First Bug: Convex vectorSearch limit exceeded Convex's vectorSearch API has a hard maximum of 256 for the limit parameter. The old code computed: - maxCandidate = Math.min(Math.max(limit * 10, 200), 1000) → up to 1000 - candidateLimit = Math.max(limit * 3, 50) → starts at 150 with your pageSize of 50 When the first iteration (150 candidates) didn't find enough exact token matches, it doubled to 300, which exceeds 256 and causes ctx.vectorSearch to throw a validation error. Since this isn't wrapped in a try/catch, it crashes the action. Fix (convex/search.ts): Cap both values at 256: - maxCandidate = Math.min(Math.max(limit * 4, 64), 256) - candidateLimit = Math.min(Math.max(limit * 2, 32), 256) ## Second Bug: Wrong parameter name in HTTP API convex/httpApi.ts was passing approvedOnly to searchSkills, but the action only accepts highlightedOnly. This would cause a Convex argument validation error for any HTTP API search calls. Fix: Changed approvedOnly: to highlightedOnly: in the runAction call. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:21 -05:00
yindo closed this issue 2026-02-15 17:16:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#220