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 <noreply@paperclip.ing>
This commit is contained in:
Dotta 2026-09-07 15:43:08 -05:00
parent 39dffd70f4
commit 895a75ddfc
2 changed files with 33 additions and 3 deletions

View File

@ -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();

View File

@ -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(