fix(codex): stop 502ing empty CLI output, GET /file no longer mkdirs or leaks paths

This commit is contained in:
2026-09-08 20:15:12 +07:00
parent 29ed86d672
commit aca8fd02ee
6 changed files with 82 additions and 14 deletions
+3 -2
View File
@@ -370,7 +370,7 @@ const paths = {
tags: ["CodexConfig"],
summary: "Read a single file body",
description:
"Read-only. Returns the body of one file. Strict path containment: the resolved absolute path must live under CODEX_HOME, the project .codex dir, or (only for a file literally named AGENTS.md) the project root.",
"Read-only, no filesystem side effect. Returns the body of one file. Strict path containment: the resolved absolute path must live under CODEX_HOME, the project .codex dir, or (only for a file literally named AGENTS.md) the project root, and must not escape that root through a symlink. Error messages never reveal what does or does not exist outside the root.",
operationId: "codexConfigGetFile",
parameters: [
{
@@ -391,7 +391,8 @@ const paths = {
},
},
},
400: errorResponse("READ_DENIED", "path is outside allowed roots"),
400: errorResponse("READ_DENIED", "path escapes the allowed root"),
404: errorResponse("NOT_FOUND", "file not found"),
},
},
put: {