Skip to content

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

295 B
Raw Blame
import { Response } from 'express';

export function flushResponseThen(
  res: Response,
  payload: unknown,
  action: () => void | Promise<void>
): void {
  res.on('finish', async () => {
    try {
      await action();
    } finally {
      process.exit(0);
    }
  });
  res.json(payload);
}