Skip to content

Commit a0ccc61

Browse files
committed
test(plugins): allow Codex auth hint provider variants
1 parent 1daa26c commit a0ccc61

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/plugins/provider-runtime.test-support.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function expectCodexMissingAuthHint(
4040
}) => string | undefined,
4141
expectedModel = "openai/gpt-5.5",
4242
) {
43-
expect(
43+
const message =
4444
buildProviderMissingAuthMessageWithPlugin({
4545
provider: "openai",
4646
env: process.env,
@@ -49,8 +49,17 @@ export function expectCodexMissingAuthHint(
4949
provider: "openai",
5050
listProfileIds: (providerId) => (providerId === "openai-codex" ? ["p1"] : []),
5151
},
52-
}),
53-
).toContain(expectedModel);
52+
}) ?? "";
53+
54+
expect(message).toContain('No API key found for provider "openai"');
55+
const acceptedModels = expectedModel.startsWith("openai/")
56+
? [expectedModel, expectedModel.replace(/^openai\//, "openai-codex/")]
57+
: [expectedModel];
58+
expect(message).toMatch(
59+
new RegExp(
60+
acceptedModels.map((model) => model.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"),
61+
),
62+
);
5463
}
5564

5665
export async function expectAugmentedCodexCatalog(

0 commit comments

Comments
 (0)