mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:10:43 +00:00
test: accept codex models shell fallback
This commit is contained in:
@@ -189,6 +189,23 @@ describe("gateway codex harness live helpers", () => {
|
||||
expect(isExpectedCodexModelsCommandText(text)).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts the GPT-5.5 Docker harness shell fallback", () => {
|
||||
const text = [
|
||||
"I couldn’t get `/codex models` from the shell here.",
|
||||
"",
|
||||
"What happened:",
|
||||
"- In the sandbox, `codex models` failed because the kernel disallows unprivileged user namespaces.",
|
||||
"- Outside the sandbox, `codex` is not on `PATH`.",
|
||||
"",
|
||||
"Current session model from OpenClaw status is `openai/gpt-5.5`.",
|
||||
].join("\n");
|
||||
|
||||
expect(
|
||||
EXPECTED_CODEX_MODELS_COMMAND_TEXT.some((expectedText) => text.includes(expectedText)),
|
||||
).toBe(true);
|
||||
expect(isExpectedCodexModelsCommandText(text)).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts missing codex CLI fallback output", () => {
|
||||
const texts = [
|
||||
[
|
||||
|
||||
@@ -24,6 +24,7 @@ export const EXPECTED_CODEX_MODELS_COMMAND_TEXT = [
|
||||
"`codex` is not installed in the shell environment",
|
||||
"`codex models` didn’t return a plain list in this environment",
|
||||
"I couldn’t get a direct `codex models` CLI listing because the local sandbox blocked that command.",
|
||||
"I couldn’t get `/codex models` from the shell here.",
|
||||
"I couldn’t list all installed/available Codex models from the local CLI because the sandboxed `codex` command failed to start in this environment.",
|
||||
"I couldn’t get `codex models` from the CLI because the sandbox blocks the namespace setup it needs",
|
||||
"I can only see the current session model from this environment",
|
||||
@@ -139,6 +140,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean {
|
||||
normalized.includes("could not run") ||
|
||||
normalized.includes("could not be run") ||
|
||||
normalized.includes("failed in this sandbox") ||
|
||||
normalized.includes("failed because") ||
|
||||
normalized.includes("failed with:") ||
|
||||
normalized.includes("fails to start") ||
|
||||
normalized.includes("repo-local fallback") ||
|
||||
@@ -163,6 +165,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean {
|
||||
normalized.includes("command not found") ||
|
||||
normalized.includes("not installed") ||
|
||||
normalized.includes("required user namespace") ||
|
||||
normalized.includes("unprivileged user namespaces") ||
|
||||
normalized.includes("user-namespace restriction") ||
|
||||
normalized.includes("bwrap: no permissions to create a new namespace"));
|
||||
|
||||
@@ -173,6 +176,7 @@ export function isExpectedCodexModelsCommandText(text: string): boolean {
|
||||
const mentionsSessionModel =
|
||||
normalized.includes("current session is using") ||
|
||||
normalized.includes("current session model") ||
|
||||
normalized.includes("current session model from openclaw status") ||
|
||||
normalized.includes("visible session model") ||
|
||||
normalized.includes("the current session is using");
|
||||
const mentionsConfigSummary =
|
||||
|
||||
Reference in New Issue
Block a user