ChatGPT is a product not for you to program or think about. It is for you to consume.
The documentation is all about using it, not asking programming questions about it, as you don’t develop your own software to call ChatGPT, and the Codex SDK means you have given up writing software and instead committed to comprehending obtuse proprietary software. The Codex SDK uses an app server layer, abstracting the remote communication, but you do have the source if you really want to see.
Here’s a link to official documentation about as technically deep as you will get, how to set permissions on a sandbox for the equivalent of shell tool: Codex App Server | ChatGPT Learn
Here’s the SDK source, if you want to investigate ultimate calls to pay-per-use API (which does have moderate documentation), vs ChatGPT’s API and subscription account use:
Thanks—the App Server documentation is a useful lead. My question is narrower: does the Codex desktop functions.exec nested shell_command result map exactly to App Server command/exec or commandExecution?
If so, could you point me to the exact repository URL, commit/tag, source file, and generated type that define that mapping, including output truncation and completeness behavior?
Likewise, which App Server type maps to the nested apply_patch result, and what postcondition does a completed result guarantee?
I’m trying to distinguish an implementation-specific mapping from the public App Server protocol itself.
Hey yuta_yuuta, thanks for clarifying your question!
These two official OpenAI resources are more closely aligned with what you're looking for:
Codex App Server Documentation — Covers command/exec, commandExecution, and fileChange result structures, including execution status and output fields.
However, as _j highlighted, the exact implementation details remain unavailable in the public documentation, so these resources may not fully answer your questions about functions.exec result mappings and completeness guarantees.
You can also try reaching out to support@openai.com to see if they can provide further clarification on your request.
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:
Does the fulfilled value from nested shell_command map exactly to App Server command/exec, a commandExecution item, or another internal wrapper?
If this mapping exists, what source file, generated type, version, or commit defines it?
How can a client determine whether stdout and stderr are complete or truncated? Does a completed result guarantee that all output was delivered?
What is the exact result schema and postcondition contract for nested apply_patch?
Are returned JavaScript values guaranteed to be ordinary non-Proxy objects, structured-clone values, or another documented representation?
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.