mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-29 15:25:14 +00:00
Behavior addressed: The codex-cli metadata branch no longer calls process.exit(0) immediately after writing stdout, and it still emits exactly one unsupported-backend JSON object. Real environment tested: Local OpenClaw source checkout on macOS with Node/tsx. Exact steps or command run after this patch: pnpm test test/scripts/print-cli-backend-live-metadata.test.ts test/scripts/docker-build-helper.test.ts; node --import tsx scripts/print-cli-backend-live-metadata.ts codex-cli | python3 -c 'import sys,json; print(json.load(sys.stdin)["provider"])'; autoreview --mode branch --base origin/main --no-web-search. Evidence after fix: Focused tooling test shard passed 2 files / 23 tests; direct pipe parse printed codex-cli; autoreview reported no accepted/actionable findings; PR status rollup was clean. Observed result after fix: stdout is parseable as a single JSON payload and the normal metadata path is skipped for codex-cli. What was not tested: Live provider metadata paths beyond the focused existing test coverage. Co-authored-by: Iftekhar Uddin <ifuddin3@gmail.com>
20 lines
642 B
TypeScript
20 lines
642 B
TypeScript
import { execFileSync } from "node:child_process";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
describe("print-cli-backend-live-metadata", () => {
|
|
it("prints one parseable unsupported codex-cli JSON payload", () => {
|
|
const stdout = execFileSync(
|
|
process.execPath,
|
|
["--import", "tsx", "scripts/print-cli-backend-live-metadata.ts", "codex-cli"],
|
|
{ encoding: "utf8" },
|
|
);
|
|
|
|
expect(JSON.parse(stdout)).toEqual({
|
|
provider: "codex-cli",
|
|
unsupported: true,
|
|
reason:
|
|
"codex-cli is no longer a bundled CLI backend. Use openai/* with the Codex app-server runtime instead.",
|
|
});
|
|
});
|
|
});
|