mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:00:44 +00:00
test: accept codex agent model list
This commit is contained in:
@@ -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 can’t 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`).",
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user