graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
Merge PR #1132 onto the 0.0.302.2 line
Cursor Agent61d3f328ae8d
diff --cc apps/native/app/api/acp/route.tsindex 129cf10d,6ff64291..d1600d6b--- a/apps/native/app/api/acp/route.ts+++ b/apps/native/app/api/acp/route.ts@@@ -13,7 -13,7 +13,8 @@@ import { prepareGuiPrompt } from "@/libimport { attachmentStore } from "@/lib/attachment-store";import { retireWorker } from "@/lib/acp-retire";+import { rememberAnswer, validateAnswer } from "@/lib/ask-answer";+ import { formatTermination, recordTermination, type TerminateReason } from "@/lib/acp-terminate";import { initializeWorker, serializeBootstrap } from "@/lib/acp-bootstrap";import { finishCancelledPrompt } from "@/lib/acp-cancel";import { armIdle, cancelIdle, forgetPark, forgetParkMatching, keepPark, parkedChats, takeParked, type ParkedWorker } from "@/lib/acp-idle";@@@ -45,8 -45,7 +46,9 @@@ type Slot =restartReady: Promise<void> | null;/** Open session/idle SSE subscribers (peer pump). */idleListeners: number;+ /** `session/answer` call_ids already delivered to this worker. */+ answered: Set<string>;+ spawnedAt: number;};const HANDSHAKE_MS = 120_000;@@@ -177,7 -185,7 +188,8 @@@ function spawnAgent(chat: string, optsidleListeners: 0,restart: false,restartReady: null,+ answered: new Set<string>(),+ spawnedAt: Date.now(),};slot.transport = new AcpTransport(child, message => noteCommands(slot, message));child.on("error", (err) => {@@@ -275,10 -283,8 +287,10 @@@ async function bootstrapNow(chat: strintry { await slot.restartReady; }finally { if (slots.get(chat) === slot) slots.delete(chat); }}, HANDSHAKE_MS);+ slot.sessionId = created.sessionId;+ if (created.cwd) slot.cwd = created.cwd;if (!slot.resume) registerSessionWriter(sessionFile(slot.cwd, slot.sessionId), slot.child, () => {- if (slots.get(chat) === slot) void killSlot(chat).catch(() => undefined);+ if (slots.get(chat) === slot) void killSlot(chat, undefined, "session-writer").catch(() => undefined);});await drainCommands(slot);if (slots.get(chat) !== slot) throw new Error("ACP startup was disposed. Retry to start a new worker.");