test: accept codex agent model list

This commit is contained in:
Peter Steinberger
2026-04-28 04:41:50 +01:00
parent 093dba3806
commit 1df48506a7
2 changed files with 23 additions and 0 deletions

View File

@@ -123,6 +123,23 @@ describe("gateway codex harness live helpers", () => {
expect(isExpectedCodexModelsCommandText(text)).toBe(true);
});
it("accepts the current Codex agent model list from the live harness", () => {
const text = [
"Available Codex agent models:",
"",
"- `dev`: `openai/gpt-5.5`",
" - Runtime: `codex`",
" - Configured: `false`",
"",
"No other agent models are currently exposed for this session.",
].join("\n");
expect(
EXPECTED_CODEX_MODELS_COMMAND_TEXT.some((expectedText) => text.includes(expectedText)),
).toBe(true);
expect(isExpectedCodexModelsCommandText(text)).toBe(true);
});
it("accepts sandbox namespace failures with current-session model fallback", () => {
const text = [
"I cant enumerate `/codex models` from this sandbox because the local `codex` CLI fails to start here with a user-namespace restriction (`bwrap: No permissions to create a new namespace`).",

View File

@@ -1,6 +1,7 @@
export const EXPECTED_CODEX_MODELS_COMMAND_TEXT = [
"Codex models:",
"Available Codex models",
"Available Codex agent models",
"Available models:",
"Available models, local cache:",
"Available agent target:",
@@ -184,6 +185,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean {
const mentionsVisibleOptions =
normalized.includes("visible options in this session:") ||
normalized.includes("visible options:") ||
normalized.includes("available codex agent models:") ||
normalized.includes("available model overrides listed in this session:") ||
normalized.includes("available model overrides shown in this session:") ||
normalized.includes("available here:") ||
@@ -204,6 +206,9 @@ export function isExpectedCodexModelsCommandText(text: string): boolean {
const isAgentIdModelSummary =
normalized.includes("available agent ids in this session:") &&
(text.includes("`openai/") || text.includes("`codex/"));
const isCodexAgentModelSummary =
normalized.includes("available codex agent models:") &&
(text.includes("`openai/") || text.includes("`codex/"));
const isAvailableHereModelSummary =
normalized.includes("available here:") &&
normalized.includes("current session model") &&
@@ -219,6 +224,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean {
isSessionConfigFallback ||
isInteractiveSelectionSummary ||
isAgentIdModelSummary ||
isCodexAgentModelSummary ||
isAvailableHereModelSummary ||
isInteractiveTuiSummary
);