Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
/** One execution owns feedback; any number of continuations may await its promise. */
export function runChatSwitchRequest(
execute: () => Promise<void>,
isCurrent: () => boolean,
onCurrentError: (error: unknown) => void
): Promise<void> {
return execute().catch(error => {
if (isCurrent()) onCurrentError(error)
throw error
})
}