mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-04 11:01:16 +01:00
fix(runner): retain cancelled Claude setup writes without blocking abort
Align Pi catalog expectations with profile 25 and verify cancellation settles before a blocked settings write, including late write failure. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
519e8369a1
commit
dd82936c1d
3 files changed
+20
-5
No files matched your search
@@ -264,7 +264,7 @@ describe("ACPX runtime host", () => {
|
||||
} finally { await nextOwner.close({ reason: "next owner complete" }); }
|
||||
});
|
||||
|
||||
it("keeps the Claude lifetime lease until an owned settings write settles after cancellation", async () => {
|
||||
it.each([false, true])("cancels Claude startup promptly while retaining its settings write and lease (late failure: %s)", async failWrite => {
|
||||
const fixture = await hostFixture();
|
||||
const controller = new AbortController();
|
||||
let announceWrite!: () => void;
|
||||
@@ -280,6 +280,7 @@ describe("ACPX runtime host", () => {
|
||||
return { ...sandbox, initializeOwnedConfiguration: async () => {
|
||||
announceWrite();
|
||||
await writePending;
|
||||
if (failWrite) throw new Error("settings write failed after cancellation");
|
||||
await initialize?.();
|
||||
} };
|
||||
};
|
||||
@@ -289,6 +290,8 @@ describe("ACPX runtime host", () => {
|
||||
try {
|
||||
await writeStarted;
|
||||
controller.abort(new Error("settings admission cancelled"));
|
||||
await runAcpxOperationAttempt(() => rejected, Date.now() + 1_000);
|
||||
expect(openRuntime).not.toHaveBeenCalled();
|
||||
await expect(AcpxRuntimeHost.open(options, fixture.dependencies({ openRuntime }))).rejects.toThrow("already has an active lease");
|
||||
} finally { finishWrite(); }
|
||||
await rejected;
|
||||
|
||||
@@ -483,7 +483,19 @@ export class AcpxRuntimeHost {
|
||||
});
|
||||
}
|
||||
options.signal?.throwIfAborted();
|
||||
await sandbox.initializeOwnedConfiguration?.();
|
||||
const configurationLifetime = credential;
|
||||
await runAbortableAdmissionStage(
|
||||
options.signal,
|
||||
async () => { await sandbox.initializeOwnedConfiguration?.(); },
|
||||
cleanup => {
|
||||
pendingRuntimeOwnsCredential = true;
|
||||
const retained = cleanup.then(() => cleanupAbortedRuntimeAdmission(
|
||||
null, configurationLifetime, "ACPX owned configuration cancelled",
|
||||
));
|
||||
retainRuntimeHostCleanup(retained);
|
||||
dependencies.retainAdmissionCleanup?.(retained);
|
||||
},
|
||||
);
|
||||
options.signal?.throwIfAborted();
|
||||
assertAcpxProfileEnvironment(options.agent, sandbox.launchEnvironment);
|
||||
let launchEnvironment = sandbox.launchEnvironment;
|
||||
|
||||
@@ -189,8 +189,8 @@ describe("Pi controls catalog admission", () => {
|
||||
// Extended v3 states the strict file oracle's task-wide Bash limit.
|
||||
const pi = runnerMatrix.find(c => c.profile.qualificationCandidate === "pi")!.profile;
|
||||
expect(pi.modelQualification?.qualificationId).toBe("pi:0.0.33:1.0.0:openrouter");
|
||||
expect(runnerSuites.find(s => s.id === "pi-native")!.definitionMetadata).toMatchObject({ version: 23, remoteProcExit: "separately-confirmed-absence-after-read-failure", taskCreation: "explicit-title-and-creation-response-id", agentMemoryParent: "public-managed-file-seed-before-admission", incompleteTerminalCleanup: "retirement-retained-with-failed-watch", profileVersion: 23, agentMemoryContent: "utf8-nonce-plus-final-lf", agentMemoryPrompt: "single-json-write-and-content-bound-native-read-both-runs", agentMemoryReadAuthority: "local-withheld-or-exact-remote-agent-run-file", taskPromptTransport: "fenced-markdown-paste-and-multiline-literal-escapes", nativeFinish: "current-contract-objective-evidence-refs", providerFaultExecutable: "stable-preinstalled-runner-link-and-snapshot-node-inode-with-held-bootstrap-fd-3-or-7" });
|
||||
expect(runnerSuites.find(s => s.id === "pi-controls")!.definitionMetadata).toMatchObject({ version: 10, remoteProcExit: "separately-confirmed-absence-after-read-failure", taskCreation: "explicit-title-and-creation-response-id", profileVersion: 23,
|
||||
expect(runnerSuites.find(s => s.id === "pi-native")!.definitionMetadata).toMatchObject({ version: 23, remoteProcExit: "separately-confirmed-absence-after-read-failure", taskCreation: "explicit-title-and-creation-response-id", agentMemoryParent: "public-managed-file-seed-before-admission", incompleteTerminalCleanup: "retirement-retained-with-failed-watch", profileVersion: 25, agentMemoryContent: "utf8-nonce-plus-final-lf", agentMemoryPrompt: "single-json-write-and-content-bound-native-read-both-runs", agentMemoryReadAuthority: "local-withheld-or-exact-remote-agent-run-file", taskPromptTransport: "fenced-markdown-paste-and-multiline-literal-escapes", nativeFinish: "current-contract-objective-evidence-refs", providerFaultExecutable: "stable-preinstalled-runner-link-and-snapshot-node-inode-with-held-bootstrap-fd-3-or-7" });
|
||||
expect(runnerSuites.find(s => s.id === "pi-controls")!.definitionMetadata).toMatchObject({ version: 10, remoteProcExit: "separately-confirmed-absence-after-read-failure", taskCreation: "explicit-title-and-creation-response-id", profileVersion: 25,
|
||||
remoteProcessIdentity: "observer-pid-startTicks-bootId",
|
||||
controlPlaneSettlement: "required-scoped-result-and-terminal-after-runner" });
|
||||
expect(runnerSuites.find(s => s.id === "extended-harnesses")!.definitionMetadata).toMatchObject({ version: 5, piFileArtifactTitle: "exact-filename", piFileCommandTransport: "fenced-bash-markdown-paste" });
|
||||
@@ -200,7 +200,7 @@ describe("Pi controls catalog admission", () => {
|
||||
}
|
||||
const hashes = Object.fromEntries(runnerSuites.filter(s => ["pi-native", "native-active-stop", "extended-harnesses", "rich-acp-warm-continuity"].includes(s.id)).map(s => [s.id, suiteDefinitionHash(s)]));
|
||||
expect(hashes).toEqual({
|
||||
"pi-native": "3c77ced7edfb99aa12052f451398da7580466a54abadcaf287d31ee12c16382d",
|
||||
"pi-native": "fca73103d5791b9babe5b51cdbb38629c7b30732687969f4714f8af133803df9",
|
||||
"native-active-stop": "2d4fdeeb75bd531b309bd1b35cfa5680ceefdeee6b7155b068dd011ce9901980",
|
||||
"rich-acp-warm-continuity": "331b88d9538a132670789fb7864df7df5f4bf294ae19b62f53d8a02f901774f0",
|
||||
"extended-harnesses": "5de4fac78d4d581bc0954f07b5cf2df2862d37f8b0205325eede6d9ef6d9f5e6",
|
||||
|
||||
Reference in new issue
Block a user