mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 09:39:53 +01:00
test: explicitly select fake Codex for native recovery fixture
This commit is contained in:
1 parent
1c5058a98e
commit
a5142d1f68
1 file changed
+6
@@ -24,6 +24,7 @@ import {
|
||||
nativeRunResults,
|
||||
} from "@paperclipai/db";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import * as codexCommandResolver from "../../../../packages/paperclip-runner/src/drivers/codex/codex-command.js";
|
||||
import {
|
||||
CodexAppServerDriver,
|
||||
HarnessDriverBackend,
|
||||
@@ -743,6 +744,10 @@ const recoveryFakeCodex = resolve(
|
||||
runnerDiagnostics.push(chunk.slice(-4_096));
|
||||
if (runnerDiagnostics.length > 32) runnerDiagnostics.shift();
|
||||
};
|
||||
// The production resolver prefers installed Codex over PATH. Explicitly
|
||||
// bind this disposable fixture so it can never invoke a real provider.
|
||||
const resolveFixtureCodex = vi.spyOn(codexCommandResolver, "resolveCodexCommand")
|
||||
.mockReturnValue(join(bin, "codex"));
|
||||
process.env.PAPERCLIP_RUNNER_STATE_DIR = stateBase;
|
||||
try {
|
||||
await Promise.all(
|
||||
@@ -1227,6 +1232,7 @@ const recoveryFakeCodex = resolve(
|
||||
Promise.resolve().then(() => session.close({ reason: "Recovery fixture cleanup" })),
|
||||
));
|
||||
const closeFailures = closed.filter((result) => result.status === "rejected");
|
||||
resolveFixtureCodex.mockRestore();
|
||||
runnerPrpWebSocketInternals.resetForTests();
|
||||
server.closeAllConnections();
|
||||
await new Promise<void>((done) => server.close(() => done()));
|
||||
|
||||
Reference in new issue
Block a user