Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/sim/blocks/blocks/pinecone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,15 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
if (params.deleteAll != null && params.deleteAll !== '') {
result.deleteAll = params.deleteAll === true || params.deleteAll === 'true'
}
if (params.options != null && params.options !== '') {
const options = Array.isArray(params.options)
? params.options
: typeof params.options === 'string'
? JSON.parse(params.options)
: []
result.includeValues = options.includes('includeValues')
result.includeMetadata = options.includes('includeMetadata')
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkbox options never reach query

High Severity

The new mapper reads params.options as an array of selected IDs, but checkbox-list stores each choice as a boolean under the option id (includeValues / includeMetadata), and those keys are dropped during block param extraction. UI selections never set the tool flags, so search always sends both as false after the hardcoded true defaults were removed.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fd9e9b7. Configure here.

Comment on lines +517 to +525

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Dead options→include mapping*

When a user enables Include Values and/or Include Metadata on a Pinecone search_vector block, CheckboxList persists booleans under the option ids includeValues/includeMetadata and never writes a selected-ID array on params.options. extractBlockParams only emits declared subBlock ids, so this branch never runs and search_vector always sends includeValues/includeMetadata as false (replacing the previous hardcoded true), so checked options never change the Pinecone query body.

Knowledge Base Used: Blocks Module

return result
},
},
Expand Down
24 changes: 24 additions & 0 deletions apps/sim/tools/pinecone/search_vector.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @vitest-environment node
*/
import { describe, expect, it } from 'vitest'
import { searchVectorTool } from '@/tools/pinecone/search_vector'

const baseParams = {
apiKey: 'test-key',
indexHost: 'https://example.pinecone.io',
vector: [0.1, 0.2],
}

describe('Pinecone vector search output options', () => {
it.each([
[{}, false, false],
[{ includeValues: true }, true, false],
[{ includeMetadata: true }, false, true],
[{ includeValues: true, includeMetadata: true }, true, true],
])('sends the selected options (%j)', (options, includeValues, includeMetadata) => {
const body = searchVectorTool.request.body?.({ ...baseParams, ...options })

expect(body).toMatchObject({ includeValues, includeMetadata })
})
})
4 changes: 2 additions & 2 deletions apps/sim/tools/pinecone/search_vector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export const searchVectorTool: ToolConfig<PineconeSearchVectorParams, PineconeRe
? JSON.parse(params.filter)
: params.filter
: undefined,
includeValues: true, //TODO: Make this dynamic
includeMetadata: true, //TODO: Make this dynamic
includeValues: params.includeValues ?? false,
includeMetadata: params.includeMetadata ?? false
}),
},

Expand Down
Loading