feat: switch agent to a periodic dump rather than long running process

This commit is contained in:
Aarnav Tale
2026-03-27 13:19:16 -04:00
parent 2c57187628
commit ee59a2d06d
17 changed files with 521 additions and 464 deletions
+4 -1
View File
@@ -19,8 +19,11 @@ export async function loader({ request, context }: Route.LoaderArgs) {
let closed = false;
const encoder = new TextEncoder();
const send = (event: string, data: unknown) => {
if (!closed) {
if (closed) return;
try {
controller.enqueue(encoder.encode(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`));
} catch {
closed = true;
}
};