I’m trying to identify the supported result contract for programmatic tool calls inside Codex—not the ChatGPT API or the Responses API.

The official App Server documentation shows that command/exec returns:

{
  "exitCode": 0,
  "stdout": "...",
  "stderr": ""
}

Reference:

In the Codex environment I’m using, functions.exec can invoke nested tools such as shell_command and apply_patch, but its declared return type is only Promise<unknown>.

Could someone clarify:

  1. Does the fulfilled value from nested shell_command map exactly to App Server command/exec, a commandExecution item, or another internal wrapper?
  2. If this mapping exists, what source file, generated type, version, or commit defines it?
  3. How can a client determine whether stdout and stderr are complete or truncated? Does a completed result guarantee that all output was delivered?
  4. What is the exact result schema and postcondition contract for nested apply_patch?
  5. Are returned JavaScript values guaranteed to be ordinary non-Proxy objects, structured-clone values, or another documented representation?
  6. Is this result contract versioned or covered by a compatibility guarantee?

If these are intentionally internal and unsupported contracts, confirmation of that would also answer the question.