openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

feat: add Composio toolkit cache refresh button to admin dashboard

Open Al629176 opened this issue 5 months ago • 3 comments

Description

Expose the existing Composio toolkit cache refresh API as a button/action in the admin dashboard, so admins can manually clear cached Composio toolkit responses whenever new toolkits are added or existing ones are updated — instead of waiting for the cache to expire.

Why

Composio responses are cached for 24 hours. When the Composio Toolkit site changes (e.g. a new toolkit is added or an existing one is updated), the UI does not immediately reflect those changes. Admins need a way to force-refresh the cache from the dashboard without waiting for the TTL to expire.

Implementation

  • The cache refresh API already exists — this task is purely about surfacing it in the admin dashboard UI
  • Add a "Refresh Composio Toolkits" button to the relevant section of the admin dashboard
  • On click: call the existing cache refresh API, clear cached Composio toolkit metadata so subsequent requests return fresh data
  • Show a loading state while the refresh is in progress
  • On success: show a toast/confirmation message confirming the cache was cleared
  • On error: surface the error clearly (toast/snackbar) with enough detail for the admin to understand what went wrong
  • Log the action server-side: timestamp + admin user who triggered the refresh

Acceptance Criteria

  • [ ] "Refresh Composio Toolkits" button is visible and accessible in the admin dashboard
  • [ ] Clicking the button calls the existing cache refresh API successfully
  • [ ] Cached Composio toolkit metadata is cleared — subsequent requests return fresh data from Composio
  • [ ] Success state is surfaced in the UI (toast / confirmation message)
  • [ ] Errors are surfaced clearly in the UI (toast / snackbar / inline message)
  • [ ] Action is logged server-side with timestamp and acting admin user

Related

  • #3907 — Dynamic Composio integrations + backend-driven toolkit slugs

Implementation Plan

Triage Assessment

YellowSnnowmann's investigation (comment 2026-06-24) correctly identifies that the issue's premise is flawed: there is no server-side Composio toolkit cache to refresh. The 24h cache lives client-side in app/src/lib/composio/catalogCache.ts (localStorage). The "admin dashboard" is ambiguous between the separate dashboard repo and openhuman's ComposioPanel.tsx. Issue needs re-scoping per the two paths proposed in the investigation comment.

Proposed Scope

Two options. Recommend Option 1 (client-side, matches reality) for fast delivery. Option 2 (full server-side) if observability requirements justify the cost.

  • Option 1 (recommended): Add refresh button to openhuman's ComposioPanel.tsx that calls invalidateToolkitCatalogCache() + refetches. Drops "server-side API" and "server-side logging" criteria.
  • Option 2: Build a backend Composio cache layer, refresh API, audit log, core RPC, and dashboard button. Net-new backend work.

Implementation Steps (Option 1)

  1. Open app/src/components/settings/panels/ComposioPanel.tsx. Add a "Refresh Composio Toolkits" button in the relevant section.
  2. On click: call invalidateToolkitCatalogCache() from app/src/lib/composio/catalogCache.ts, then trigger a refetch of the toolkit catalog.
  3. Show loading state (isRefreshing state in component) while refetch is in progress.
  4. On success: show confirmation toast via the existing notification system.
  5. On error: surface error in toast with actionable detail.
  6. Update the issue title and body to reflect Option 1 scope, or re-open with the maintainer's decision on Option 1 vs 2.

Verification

  • Unit: app/src/lib/composio/catalogCache.test.ts -- confirm invalidation + refetch.
  • Manual: click button in ComposioPanel, confirm toolkit list is reloaded.

Risks and Open Questions

  • Open: maintainer needs to confirm Option 1 vs Option 2.
  • If Option 2 is chosen, scope expands to building server-side Composio caching in backend-alphahuman/src/routes/agentIntegrations/composio.ts.

Acceptance Criteria

  • [ ] "Refresh Composio Toolkits" button in ComposioPanel.
  • [ ] Clicking calls invalidateToolkitCatalogCache() + refetches.
  • [ ] Success state shown (toast).
  • [ ] Errors surfaced (toast).

Al629176 avatar Jun 24 '26 08:06 Al629176

Before picking this up I traced the "cache refresh API already exists" assumption through all three candidate surfaces, and it doesn't hold as written. Flagging the specifics so we can re-scope.

The 24h toolkit cache only exists client-side

The only real Composio toolkit cache + refresh primitive lives in the openhuman frontend:

  • app/src/lib/composio/catalogCache.ts — localStorage cache, TTL_MS = 24h, key composio:catalog:v1, with invalidateToolkitCatalogCache() (the refresh primitive).
  • It's invalidated today via a composio:config-changed CustomEvent (dispatched from ComposioPanel.tsx, consumed in lib/composio/hooks.ts), not an HTTP/RPC endpoint.

This cache is per-user, on each device's localStorage — there's nothing shared/server-side to refresh centrally.

The backend has no toolkit cache at all

In backend-alphahuman, the Composio routes (src/routes/agentIntegrations/composio.ts) have no refresh/invalidate endpoint, and there's no 24h cache to refresh:

  • composioListToolkitsController returns a static env allowlist (getEnabledToolkits()) — no TTL, no cache.
  • composioListToolsController hits the Composio SDK live on every request — no caching layer (no Redis/in-memory).

So the premise "the cache refresh API already exists — this task is purely about surfacing it" isn't accurate; there is no server-side refresh API and no server-side cache behind one.

"admin dashboard" is ambiguous, and conflicts with where the cache is

  • The actual admin dashboard is the separate dashboard repo (Clerk + isAdmin gated, Integrations page) — but it has zero Composio functionality and no access to openhuman's client-side cache.
  • The openhuman app has no admin dashboard; admin/dev actions live as Settings panels (e.g. ComposioPanel.tsx).

So the button's natural home (admin dashboard) and the thing it would refresh (openhuman client cache) are in different apps.

Acceptance criteria that can't be met as written

  • "Cached Composio toolkit metadata is cleared — subsequent requests return fresh data" — only achievable as a client-side localStorage invalidation in openhuman, not a shared server refresh.
  • "Action is logged server-side with timestamp and acting admin user" — requires a server endpoint that doesn't exist; there's no server-side action to log today.

Proposed paths

  1. Quick / client-side (matches reality): add the button to openhuman ComposioPanel.tsx, calling invalidateToolkitCatalogCache() + refetch, with loading + toast. Drops the "server-side API" and "server-side logging" criteria (neither exists). Small, shippable.
  2. Full server-side version (bigger than the ticket implies): build a real backend cache (so there's something to share/refresh), a refresh/invalidate route + audit logging in backend-alphahuman, a core RPC in openhuman, and the dashboard button. This is net-new backend work, not "surfacing an existing API."

Could you confirm (a) which surface the button should live on (openhuman Settings vs the dashboard admin app) and (b) whether we want option 1 or option 2? Happy to take either — just want to align before building, since the issue assumes infra that isn't there.

cc related: #3907

YellowSnnowmann avatar Jun 24 '26 10:06 YellowSnnowmann

Product triage note (2026-08-23)

Disposition: premise needs correction and priority should be reduced. Evidence/action: The toolkit catalog cache is client-side localStorage, not a server cache, and the current product has no matching admin dashboard. Re-scope this to a Settings refresh action, or close it as an invalid premise if an admin surface is not planned.

Felyx-Fu avatar Aug 23 '26 13:08 Felyx-Fu

Triage: invalid — The proposed admin refresh API does not exist; the reported cache is client-side localStorage, so the issue premise is incorrect. Closing as not planned.

senamakel avatar Oct 09 '26 17:10 senamakel