fix(codex): treat a literal null from the CLI as an empty list, not a 500
This commit is contained in:
@@ -321,6 +321,19 @@ describe("codex-cli run outcomes", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("treats a literal `null` on stdout as an empty list, not a crash", async () => {
|
||||
// `null` is valid JSON, so it parses and slips past the unparseable-output
|
||||
// guard. Reading `.installed` off it would surface as a 500 from a route
|
||||
// whose whole contract is that CLI output never produces one.
|
||||
const restore = stubCodex("echo null");
|
||||
try {
|
||||
assert.deepEqual((await cli.pluginList()).data, []);
|
||||
assert.deepEqual((await cli.marketplaceList()).data, []);
|
||||
} finally {
|
||||
restore();
|
||||
}
|
||||
});
|
||||
|
||||
it("unwraps `codex plugin marketplace list --json`'s {marketplaces} object into a bare array", async () => {
|
||||
const restore = stubCodex(`cat <<'JSON'\n{"marketplaces":[{"name":"sg"}]}\nJSON`);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user