From 895a75ddfc32e4bfba641945abb513541744bc12 Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 7 Sep 2026 15:43:08 -0500 Subject: [PATCH] Admit ACPX Pi through the verified native runner Keep the unverified backend closed while allowing the descriptor-confined runner path, with regression coverage through the production session entry point. Co-Authored-By: Paperclip --- .../native-session-executor.test.ts | 31 ++++++++++++++++++- .../native-runtime/native-session-executor.ts | 5 +-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/server/src/services/native-runtime/native-session-executor.test.ts b/server/src/services/native-runtime/native-session-executor.test.ts index 6729b76e28..70ff44046b 100644 --- a/server/src/services/native-runtime/native-session-executor.test.ts +++ b/server/src/services/native-runtime/native-session-executor.test.ts @@ -3902,7 +3902,7 @@ describe("native process ownership", () => { }, ); - it("rejects ACPX Pi before constructing a backend", async () => { + it("rejects ACPX Pi without the verified runner before constructing a backend", async () => { const piExecution = { ...execution, binding: { ...execution.binding, runId: "run-acpx-pi-rejected" }, @@ -3943,6 +3943,35 @@ describe("runnerd provider runtime wiring", () => { await rm(isolatedStateDirectory, { recursive: true, force: true }); }); + it("admits ACPX Pi through the production verified-runner entry point", async () => { + const piExecution = { + ...execution, + binding: { ...execution.binding, runId: "run-acpx-pi-verified" }, + provider: { kind: "acpx", agent: "pi", model: "openrouter/deepseek/deepseek-v4-flash-0731", permissionMode: "approve-all" }, + session: { ...execution.session, normalizedSessionId: "verified-pi-session", driverKind: "acpx_runtime" }, + } as unknown as NativeExecutionInputV1; + state.createBackend.mockClear(); + state.createTransport.mockClear(); + state.execute.mockReset().mockResolvedValue({ + result: { summary: "completed" }, terminal: { runTerminalState: "succeeded" }, + turnId: "turn", normalizedSessionId: "verified-pi-session", providerSessionId: null, + driverKind: "acpx_runtime", driverVersion: "1", nativeEventCount: 1, + highestContiguousSourceSeq: 1, + }); + await executePaperclipNativeSession({ + db: leaseDb(piExecution), execution: piExecution, + runnerInstanceId: "verified-pi-runner", useRunnerd: true, + }); + expect(state.createBackend).toHaveBeenCalledWith(piExecution, expect.objectContaining({ + codexTransportFactory: expect.any(Function), + })); + state.createBackend.mock.calls[0]![1].codexTransportFactory!(); + expect(state.createTransport).toHaveBeenCalledWith(expect.objectContaining({ + provider: "acpx", acpxAgent: "pi", + })); + expect(state.execute).toHaveBeenCalledOnce(); + }); + it("passes the run checkpoint active turn into restart recovery", async () => { state.createBackend.mockClear(); state.createTransport.mockClear(); diff --git a/server/src/services/native-runtime/native-session-executor.ts b/server/src/services/native-runtime/native-session-executor.ts index fe291517bb..e10db28823 100644 --- a/server/src/services/native-runtime/native-session-executor.ts +++ b/server/src/services/native-runtime/native-session-executor.ts @@ -3697,10 +3697,11 @@ async function executePaperclipNativeSessionWithinScope( } if ( input.execution.provider.kind === "acpx" && - input.execution.provider.agent === "pi" + input.execution.provider.agent === "pi" && + !input.useRunnerd ) { throw new Error( - "paperclip_runner_provider_unsupported: ACPX Pi is unavailable until descriptor-confined verified launch is implemented", + "paperclip_runner_provider_unsupported: ACPX Pi requires the native runner's descriptor-confined verified launch", ); } const earliestPreparationStart = input.preparationSpans?.reduce(