Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.
Python agent-orchestrationaiai-agentschatopsdiscordlangchainmcpmicrosoft-teamsmulti-agentopen-sourceopenaiself-hostedslack
/**
* Wraps an async producer so that concurrent calls share a single in-flight
* promise. Each settle (resolve or reject) clears the shared promise, so a later call
* starts a fresh fetch
*/
export function coalesce<T>(producer: () => Promise<T>): () => Promise<T> {
let inFlight: Promise<T> | null = null;
return () => {
if (inFlight) return inFlight;
inFlight = producer().finally(() => {
inFlight = null;
});
return inFlight;
};
}