Skip to content

Commit 5803229

Browse files
waleedlatif1claude
andcommitted
fix(knowledge): treat empty rerankerInputCount as unset
An empty string from the Documents Sent to Reranker input passed the undefined/null guard, so Number('') = 0 → clamped to 1, sending only 1 document to the reranker instead of falling back to the 4× topK auto default. Add the empty-string check to the guard. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 232b1ca commit 5803229

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/sim/tools/knowledge/search.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ export const knowledgeSearchTool: ToolConfig<any, KnowledgeSearchResponse> = {
100100
const rerankerApiKey =
101101
typeof params.apiKey === 'string' && params.apiKey.length > 0 ? params.apiKey : undefined
102102
const rawInputCount =
103-
params.rerankerInputCount !== undefined && params.rerankerInputCount !== null
103+
params.rerankerInputCount !== undefined &&
104+
params.rerankerInputCount !== null &&
105+
params.rerankerInputCount !== ''
104106
? Number(params.rerankerInputCount)
105107
: Number.NaN
106108
const rerankerInputCount = Number.isFinite(rawInputCount)

0 commit comments

Comments
 (0)