fix(algolia): tighten tools.config, add geo/facet search + task-status tool; icon/color tweaks#5356
fix(algolia): tighten tools.config, add geo/facet search + task-status tool; icon/color tweaks#5356waleedlatif1 wants to merge 5 commits into
Conversation
…arch, task status tool - move all tools.config coercion/remapping out of tool() into a proper params() function so dynamic block references aren't destroyed before variable resolution - wire facets and getRankingInfo into the search tool so those documented outputs are actually reachable - add geo-search (aroundLatLng/aroundRadius/insideBoundingBox/insidePolygon) to search and browse_records, matching delete_by_filter - fix aroundRadius param type (string, not number, since it accepts "all") - sync batch_operations description with the real action set (delete, clear) - consolidate list_indices pagination into the shared page/hitsPerPage fields instead of duplicate listPage/listHitsPerPage - add algolia_get_task_status tool so workflows can poll a taskID instead of guessing when a write is applied - trim indexName/objectID/destination before building request URLs - add ranking-tuning and index-snapshot skills to AlgoliaBlockMeta fix(dropcontact): swap icon to the official wordmark's teal swirl mark, bgColor to match chore(grafana): bgColor to white to match brand tile convention
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Dropcontact and Grafana are visual-only: official teal swirl icon and Reviewed by Cursor Bugbot for commit 6fde39f. Configure here. |
…Page CI's subblock-id stability check correctly flagged that consolidating list_indices pagination into the shared page/hitsPerPage fields would silently drop values from already-deployed workflows. Add the rename mapping so existing saved state migrates instead of being lost.
Greptile SummaryThis PR performs a comprehensive audit and fix pass on the Algolia integration: it corrects the
Confidence Score: 4/5The change is safe to merge with one outstanding fix: the search tool still sends an untrimmed indexName in the POST body, which can cause 404s for indices where the value has stray whitespace. The apps/sim/tools/algolia/search.ts — indexName in the POST body needs .trim() to match the treatment applied across every other Algolia tool in this PR Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant W as Workflow
participant B as Algolia Block (params())
participant T as Tool (e.g. add_record)
participant A as Algolia REST API
participant GT as get_task_status Tool
W->>B: operation + subBlock values
B->>B: strip empty/null/undefined, coerce booleans, remap aliased fields
B->>T: clean params object
T->>A: "POST /1/indexes/{indexName}/... (with .trim())"
A-->>T: "{ taskID, updatedAt }"
T-->>W: output.taskID (number)
Note over W: user wires taskID to get_task_status
W->>GT: "{ indexName, taskID }"
GT->>A: "GET /1/indexes/{indexName}/task/{taskID}"
A-->>GT: "{ status: published or notPublished }"
GT-->>W: output.status
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant W as Workflow
participant B as Algolia Block (params())
participant T as Tool (e.g. add_record)
participant A as Algolia REST API
participant GT as get_task_status Tool
W->>B: operation + subBlock values
B->>B: strip empty/null/undefined, coerce booleans, remap aliased fields
B->>T: clean params object
T->>A: "POST /1/indexes/{indexName}/... (with .trim())"
A-->>T: "{ taskID, updatedAt }"
T-->>W: output.taskID (number)
Note over W: user wires taskID to get_task_status
W->>GT: "{ indexName, taskID }"
GT->>A: "GET /1/indexes/{indexName}/task/{taskID}"
A-->>GT: "{ status: published or notPublished }"
GT-->>W: output.status
|
Algolia's Get Task Status response (additionalProperties: false) only returns `status` (published | notPublished) — pendingTask belongs to the List Indices response, not this endpoint. Drop it from the tool's output, response type, and block outputs rather than inventing data.
…as from real booleans, not just strings A wired <Block.output> boolean (e.g. true) failed the `=== 'true'` string-only checks and silently flipped to the wrong value. Add a toBool helper that accepts both the dropdown's string values and a genuine boolean passed in via a dynamic reference. fix(dropcontact): render icon with currentColor instead of hardcoded fill The new teal swirl mark's fill (#0ABA9F) matched the block's bgColor exactly, making the icon invisible on its own tile. Use currentColor and set iconColor so the shared tile-contrast logic (getTileIconColorClass) renders it white-on-teal like the rest of the brand icon system.
|
@greptile review |
|
@cursor review |
Greptile caught that search.ts's body-level indexName (sent inside the multi-query POST body, not URL-encoded) wasn't trimmed like every other tool's URL-path indexName. Fixed there and in get_records.ts's per-request indexName default/override, which had the same gap.
|
Fixed in 1a8b0c3 — |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6fde39f. Configure here.
| output: { | ||
| status: data.status ?? '', | ||
| }, | ||
| } |
There was a problem hiding this comment.
Task status omits pendingTask
Medium Severity
The new algolia_get_task_status integration documents a pendingTask output and the Algolia task endpoint exposes it, but transformResponse only forwards status. Workflows and docs that branch on pendingTask never receive that field.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 6fde39f. Configure here.
| .split(',') | ||
| .map((a: string) => a.trim()) | ||
| } | ||
| if (params.facets) { |
There was a problem hiding this comment.
Search index name not trimmed
Low Severity
This change trims indexName (and related IDs) in most Algolia tools, but the search multi-query body still passes params.indexName unchanged. Leading or trailing whitespace on the index name can make search fail while other operations on the same block succeed.
Reviewed by Cursor Bugbot for commit 6fde39f. Configure here.


Summary
tools.config.toolwas doing param remapping/coercion (createIfNotExists, forwardToReplicas, copyMoveOperation→operation, deleteFilters→filters, getRecordsRequests→requests, list pagination) at serialization time, before variable resolution — this could destroy dynamic<Block.output>references. Split into a puretool()selector and a properparams()function.facetsandgetRankingInfowere never sent by the search tool, so the documentedfacets/facets_stats/_rankingInfooutputs were permanently unreachable. Wired both through.aroundLatLng/aroundRadius/insideBoundingBox/insidePolygon) only existed on delete_by_filter, not on search/browse_records — added to both.aroundRadius's declared type (wasnumber, but the field legitimately accepts"all").batch_operations' param description with the real action set (was missingdelete/clear, present elsewhere).list_indicespagination into the sharedpage/hitsPerPagefields instead of duplicatelistPage/listHitsPerPagesubBlocks + remapping.algolia_get_task_status(every write op returns ataskIDbut there was no way to poll it — cheap, high-leverage addition per the endpoint audit)..trim()on indexName/objectID/destination before building request URLs.AlgoliaBlockMeta, grounded in existing tools.Endpoints intentionally NOT added (from the audit): synonyms/rules management, API key management, multi-cluster, A/B testing, Recommend — all separate products or lower-value relative to core CRUD/search/settings coverage already in place.
Type of Change
Testing
Tested manually;
bun run lintand targeted typecheck clean.Checklist