@devries-cameron20 / composio Mirror · read-only / commits / 61feaf277
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 19:45 UTC

fix(docs): point Algolia search at renamed docs_composio index (#3684)

## The bug The live Algolia index was renamed to **`docs_composio`**, but every default in the repo still pointed at the old **`docs_composio_dev_62hi9pqz1l_pages`** in three places: 1. `.github/workflows/docs-search-sync.yml` — `ALGOLIA_INDEX_NAME` fallback 2. `docs/lib/search-index.ts` — `ALGOLIA_DEFAULT_INDEX_NAME` (used by the sync script) 3. `docs/components/custom-search-dialog.tsx` — client query fallback (×2) So unless the `ALGOLIA_INDEX_NAME` Actions variable happened to be set, the **docs-search-sync** workflow rebuilt the dead old index on every push to `next`, while the live site queried a different one. Net effect: search index updates never showed up. ## The fix Repoint the default to `docs_composio` in all three spots (+ README / CLAUDE.md docs). The env overrides still take precedence, so nothing breaks if a variable is set. ## Env to set (so it actually publishes & reads the right index) The code now defaults to `docs_composio`, so the only things that **must** be configured: **GitHub Actions (repo → Settings → Secrets and variables → Actions):** - `ALGOLIA_ADMIN_API_KEY` *(secret, required)* — without it the workflow skips the sync. - `ALGOLIA_APP_ID` *(variable, optional)* — defaults to `62HI9PQZ1L`. - `ALGOLIA_INDEX_NAME` *(variable, optional)* — now defaults to `docs_composio`; set only to override. **Vercel (Production env) — for the live search to query the same index:** - `NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY` *(required; without it the client falls back to `/api/search`)* - `NEXT_PUBLIC_ALGOLIA_APP_ID` = `62HI9PQZ1L` *(optional, defaulted)* - `NEXT_PUBLIC_ALGOLIA_INDEX_NAME` = `docs_composio` *(optional now that the default matches; set it to be explicit)* > If `NEXT_PUBLIC_ALGOLIA_INDEX_NAME` was previously set to the old name in Vercel, update or remove it — otherwise the client keeps reading the old index regardless of this PR. ## Testing - `bun run types:check` passes. - `grep` confirms no remaining references to the old index name. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Rahul Tarak committed Jun 26, 2026 at 01:52 UTC 61feaf277b6826170e98c098ea692bd0a2ebe855
5 files changed +13 -8
.github/workflows/docs-search-sync.yml
+6 -1
@@ -18,13 +18,18 @@ permissions:
18 jobs:
19 sync-search:
20 runs-on: ubuntu-latest
21 + # The Algolia admin key is stored as an environment secret, not a repo
22 + # secret. Declaring the environment is what exposes `secrets.*` (and any
23 + # env-scoped `vars.*`) to this job — without it the key resolves empty and
24 + # the sync silently skips.
25 + environment: Production
26 defaults:
27 run:
28 working-directory: ./docs
29 env:
30 ALGOLIA_APP_ID: ${{ vars.ALGOLIA_APP_ID || '62HI9PQZ1L' }}
31 ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}
27 - ALGOLIA_INDEX_NAME: ${{ vars.ALGOLIA_INDEX_NAME || 'docs_composio_dev_62hi9pqz1l_pages' }}
32 + ALGOLIA_INDEX_NAME: ${{ vars.ALGOLIA_INDEX_NAME || 'docs_composio' }}
33
34 steps:
35 - name: Checkout repository
docs/CLAUDE.md
+2 -2
@@ -87,9 +87,9 @@ Detailed documentation for Claude is organized in `.claude/`:
87
88 ## Search
89
90 -The docs search dialog uses Algolia in production when `NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY` is configured. `NEXT_PUBLIC_ALGOLIA_APP_ID` defaults to `62HI9PQZ1L`, and `NEXT_PUBLIC_ALGOLIA_INDEX_NAME` defaults to `docs_composio_dev_62hi9pqz1l_pages`. Without a search API key it falls back to `/api/search` for local development and tests. Algolia searches request `clickAnalytics`, and the client sends search result view/click events with `search-insights`.
90 +The docs search dialog uses Algolia in production when `NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY` is configured. `NEXT_PUBLIC_ALGOLIA_APP_ID` defaults to `62HI9PQZ1L`, and `NEXT_PUBLIC_ALGOLIA_INDEX_NAME` defaults to `docs_composio`. Without a search API key it falls back to `/api/search` for local development and tests. Algolia searches request `clickAnalytics`, and the client sends search result view/click events with `search-insights`.
91
92 -Run `ALGOLIA_APP_ID=62HI9PQZ1L ALGOLIA_ADMIN_API_KEY=... ALGOLIA_INDEX_NAME=docs_composio_dev_62hi9pqz1l_pages bun run sync:search` from `docs/` to rebuild the Algolia index. The sync script does not use Algolia Crawler: it creates section-sized records from MDX/OpenAPI/toolkit data, configures searchable attributes, `customRanking`, and `attributeForDistinct`, then replaces the index objects. Use `bun run sync:search --dry-run --samples` to inspect generated records and `ALGOLIA_SEARCH_API_KEY=... bun run test:search "oauth auth config"` to test live relevance.
92 +Run `ALGOLIA_APP_ID=62HI9PQZ1L ALGOLIA_ADMIN_API_KEY=... ALGOLIA_INDEX_NAME=docs_composio bun run sync:search` from `docs/` to rebuild the Algolia index. The sync script does not use Algolia Crawler: it creates section-sized records from MDX/OpenAPI/toolkit data, configures searchable attributes, `customRanking`, and `attributeForDistinct`, then replaces the index objects. Use `bun run sync:search --dry-run --samples` to inspect generated records and `ALGOLIA_SEARCH_API_KEY=... bun run test:search "oauth auth config"` to test live relevance.
93
94 ## API Versioning
95
docs/README.md
+2 -2
@@ -81,7 +81,7 @@ Docs search uses Algolia when `NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY` is set; other
81 ```bash
82 NEXT_PUBLIC_ALGOLIA_APP_ID=62HI9PQZ1L # optional; default shown
83 NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY=...
84 -NEXT_PUBLIC_ALGOLIA_INDEX_NAME=docs_composio_dev_62hi9pqz1l_pages # optional; default shown
84 +NEXT_PUBLIC_ALGOLIA_INDEX_NAME=docs_composio # optional; default shown
85 ```
86
87 Sync the Algolia index with an admin key:
@@ -89,7 +89,7 @@ Sync the Algolia index with an admin key:
89 ```bash
90 ALGOLIA_APP_ID=62HI9PQZ1L
91 ALGOLIA_ADMIN_API_KEY=...
92 -ALGOLIA_INDEX_NAME=docs_composio_dev_62hi9pqz1l_pages bun run sync:search
92 +ALGOLIA_INDEX_NAME=docs_composio bun run sync:search
93 ```
94
95 Preview the generated records or test live relevance:
docs/components/custom-search-dialog.tsx
+2 -2
@@ -127,7 +127,7 @@ export default function CustomSearchDialog({
127 const clientOptions = useMemo(() => {
128 const appId = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID ?? '62HI9PQZ1L';
129 const searchApiKey = process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY;
130 - const indexName = process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME ?? 'docs_composio_dev_62hi9pqz1l_pages';
130 + const indexName = process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME ?? 'docs_composio';
131
132 if (appId && searchApiKey) {
133 const client = liteClient(appId, searchApiKey);
@@ -201,7 +201,7 @@ export default function CustomSearchDialog({
201 const url = new URL(href, window.location.origin);
202 const path = `${url.pathname}${url.hash}`;
203 const hit = algoliaHitMetaRef.current.get(path) ?? algoliaHitMetaRef.current.get(url.pathname);
204 - const indexName = process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME ?? 'docs_composio_dev_62hi9pqz1l_pages';
204 + const indexName = process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME ?? 'docs_composio';
205
206 if (!hit) return;
207
docs/lib/search-index.ts
+1 -1
@@ -13,7 +13,7 @@ import { mdxToCleanMarkdown } from '@/lib/source';
13 import { getAllToolkitsSync } from '@/lib/toolkit-data';
14
15 export const ALGOLIA_DEFAULT_APP_ID = '62HI9PQZ1L';
16 -export const ALGOLIA_DEFAULT_INDEX_NAME = 'docs_composio_dev_62hi9pqz1l_pages';
16 +export const ALGOLIA_DEFAULT_INDEX_NAME = 'docs_composio';
17
18 const MAX_CHUNK_CHARS = 3_800;
19 const MAX_CHUNK_BYTES = 9_000;