mirror of
https://github.com/openai/codex-security.git
synced 2026-11-25 02:58:16 +08:00
* chore(deps): bump promptfoo in /evals/triage-finding Bumps [promptfoo](https://github.com/promptfoo/promptfoo) from 0.124.1 to 0.125.1. - [Release notes](https://github.com/promptfoo/promptfoo/releases) - [Changelog](https://github.com/promptfoo/promptfoo/blob/main/CHANGELOG.md) - [Commits](https://github.com/promptfoo/promptfoo/compare/0.124.1...0.125.1) --- updated-dependencies: - dependency-name: promptfoo dependency-version: 0.125.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix(evals): bind Promptfoo to the scanner’s pinned Codex SDK Supply the eval SDK and its entry point to the native provider. Forward cancellation through custom CLI version probes and cover version mismatch in the provider fixtures. Prune obsolete overrides and optional packages, and refresh the affected HTTP and FTP dependencies. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael D'Angelo <mdangelo@openai.com>
29 lines
1023 B
TypeScript
29 lines
1023 B
TypeScript
import { readdirSync } from "node:fs";
|
|
import path from "node:path";
|
|
import { pathToFileURL } from "node:url";
|
|
import { initializeProvider } from "./triage-provider.mts";
|
|
|
|
const promptfooDist = path.resolve(
|
|
import.meta.dirname,
|
|
"../node_modules/promptfoo/dist/src",
|
|
);
|
|
|
|
// Promptfoo bundles separate native classes for the CLI, viewer,
|
|
// and public API. Initialize every ESM copy before providers are constructed,
|
|
// including viewer replay, which does not run saved extension hooks.
|
|
for (const filename of readdirSync(promptfooDist)) {
|
|
if (!filename.startsWith("codex-sdk-") || !filename.endsWith(".js")) continue;
|
|
const module = await import(
|
|
pathToFileURL(path.join(promptfooDist, filename)).href
|
|
);
|
|
for (const Provider of Object.values(module)) {
|
|
if (
|
|
typeof Provider === "function" &&
|
|
typeof Provider.prototype?.getCodexInstanceForTurn === "function" &&
|
|
typeof Provider.prototype?.callApiInternal === "function"
|
|
) {
|
|
initializeProvider(Provider.prototype);
|
|
}
|
|
}
|
|
}
|