getComposioTools() in apps/apollo/src/lib/tools/composioTools.ts calls
launchDarklyProvider.getToolDescriptionOverrides() on every invocation.
Because getToolBySlug() (in get_tools_by_filters.ts:173) calls
getComposioTools() for each slug in a multi-tool batch, a batch of N tools
produced N identical Edge Config round-trips in the same Node.js process.
getToolDescriptionOverrides() uses a global context (tool-descriptions)
with no per-project or per-request variation, so all N results are identical.
Fix: add a module-level TTL memo (_toolDescOverridesCache, 10 s) inside
composioTools.ts. The new getCachedToolDescriptionOverrides() helper
serves the cached value for up to 10 s before re-fetching.
Cache-staleness trade-off: a LaunchDarkly flag change (tool description override) will take up to 10 seconds to propagate to all in-flight Node processes, rather than taking effect immediately. Given that description overrides are non-safety-critical and LD flag changes are operator-initiated, this is an acceptable trade-off.
getToolDescriptionOverrides() takes no parameters and uses
globalCtx('tool-descriptions') (launchDarkly.ts:1226), confirming the
result has no per-project or per-request input, so a module-global memo is
safe and cannot leak overrides across projects.composioTools.test.ts (the first test seeded the cache, later tests read
the stale value instead of their own spy). Exported
resetToolDescriptionOverridesCacheForTests() and call it in beforeEach
so every test starts from a cold cache.node_modules in this
worktree); the cache logic and all four TTL test expectations plus the
pre-/post-fix regression were validated with a standalone Node simulation.🤖 Generated with Claude Code