Skip to content

Show it a video you love. Get a new video in the same style. An AI crew (Claude Code or Codex) plans, builds and reviews it with you.

Merge pull request #75 from Reiz1900/fix/agents-ttl-cache

Eden35cbc5ec0877
diff --cc app/server/agents/index.ts
index 20dc7c7,75ff3ce..b9f746d
--- a/app/server/agents/index.ts
+++ b/app/server/agents/index.ts
@@@ -99,14 -109,11 +110,14 @@@ export function runAgent({ kind, cwd, p
const st: TurnState = { sessionId, text: '', ok: false, cost: null, lastError: '' };
const emit: Emit = (e) => { if (e.type === 'error') st.lastError = e.text; onEvent(e); }; // keep the last error for the job's error card
const isClaude = kind === 'claude';
- const cmd = isClaude ? 'claude' : CODEX_BIN;
+ const cmd = isClaude ? 'claude' : codexBin();
const args = isClaude ? claudeArgs(sessionId) : codexArgs(sessionId, cwd);
// Windows: npm shims (claude.cmd) need a shell; args are fixed literals, the prompt goes through stdin.
- const child = spawn(cmd, args, { cwd, shell: IS_WIN, env: { ...process.env, HYPERFRAMES_NO_TELEMETRY: '1', DO_NOT_TRACK: '1' } });
- if (signal) signal.addEventListener('abort', () => { try { IS_WIN ? spawnSync('taskkill', ['/pid', String(child.pid), '/T', '/F']) : child.kill('SIGTERM'); } catch {} });
+ // its own process group (POSIX), so a cancel stops the renders and browsers it started too, not only the CLI
+ const child = spawn(cmd, args, { cwd, shell: IS_WIN, ...treeOpts, env: { ...process.env, HYPERFRAMES_NO_TELEMETRY: '1', DO_NOT_TRACK: '1' } });
+ // the signal lives as long as the whole flow: drop the listener when this turn ends, so finished children aren't killed (or kept) later
+ const onAbort = () => killTree(child);
+ if (signal) { if (signal.aborted) killTree(child); else signal.addEventListener('abort', onAbort, { once: true }); }
lines(child.stdout, (l) => {
let obj: Json; try { obj = JSON.parse(l); } catch { return; }
(isClaude ? parseClaude : parseCodex)(obj, emit, st);