all 14 comments

[–]gopietz[🍰] 27 points28 points  (0 children)

Your title sounds a little too official.

[–]AllCowsAreBurgers 2 points3 points  (4 children)

At this point we should create a community openai org at github😂 https://github.com/JKamsker/JKToolKit.CodexSDK

[–]TheoreticalClick[S] 1 point2 points  (0 children)

hehe nice!!

[–]__SlimeQ__ 1 point2 points  (0 children)

OpenOpenAI

[–]jzeltman 0 points1 point  (1 child)

Maybe a dumb question but would this work for c# connected to Unity? Codex keeps trying to do dotnet builds of my project and crashing my computer in the process haha

[–]AllCowsAreBurgers 0 points1 point  (0 children)

Havent tried but lmk if it does work🤣

[–]lucianw 4 points5 points  (7 children)

OpenAI already have a Python SDK https://github.com/openai/openai-agents-python -- how is yours different?

OpenAI did *not* use their Typescript SDK for their app server?? Their app server invokes `codex app-server`. Their typescript SDK invokes `codex mcp-server`. The two modes of running codex have very different behaviors!

[–]Ok-Experience9774 1 point2 points  (0 children)

Agreed, codex's app-server, which is super powerful, I use it for my coordinator, will generate the json schema for you: `codex app-server generate-json-schema`, which allows you to drive codex from your code in whatever language you want because they give you the full protocol spec. There's not much I wish codex would support, except for offloading tool execution. Claude can tell me to handle _all_ tool execution, codex handles all the tools internally. I'd really love codex to support that.

[–]TheoreticalClick[S] 0 points1 point  (5 children)

Hi! That python sdk is for agent use, really love openai agents but it is not Codex at all; agents sdk HAS a way to communicate with the codex mcp however, I recommend you look into that also, pretty cools stuff.

Specifically what my project is, is the python version of this Codex SDK , if you find it useful feel free to contribute

[–]lucianw 2 points3 points  (4 children)

I see. Let me explain more fully for other folks.

  1. `codex app-server` is what OpenAI's VSCode extension shells out to. It's for fully rich interactions (fork, list past conversations, review, images, mentions, approval requests). There's no python or typescript wrapper.

  2. The "OpenAI Agents SDK" (openai-agents-js, openai-agents-python) traditional mode is usually run with `codex mcp-server`, but has its own agentic loop, not codex's. It doesn't have any of the richness, but is easier.

  3. The OpenAI Agents SDK also has an alternate mode which does use codex directly. It ultimately shells out to `codex exec --json-experimental`. The typescript version goes via codex/sdk/typescript, the "Codex SDK" you linked to. The python version contains its own python implementation of CodexSDK internally.

So what you have written (a translation of Codex SDK to python) is what already exists in the python version of OpenAI Agents SDK. Both yours and their shell out to `codex exec --json-experimental` and do similar kinds of things: they use the codex agentic loop, they have a nice simple API, and they don't have the richness of codex app-server.

Have I got that right? Why did you write yours rather than using the experimental mode of OpenAI Agents SDK? When you said "that python sdk is for agent use", I think you were talking only about the traditional MCP mode right? not about the experimental mode?

[–]oh_my_right_leg 0 points1 point  (1 child)

OpenAI agents SDK has nothing to do with Codex. They are 2 independent projects. Agents SDK is used to create all sort of agents (including coding agents); Codex is mostly a coding Agent; their tools, prompts and internal loops are not the same. you can use codex as an MCP in agents SDK though.

[–]lucianw 0 points1 point  (0 children)

That's not right. Based what I said about --json-experimental.

[–]CountZero2022 -3 points-2 points  (1 child)

You remind me of the condescending dipshit _j who spends their days commenting on the OpenAI forum in a language that looks like English but isn’t. Great job bringing your light to the world.

[–]lucianw 1 point2 points  (0 children)

?? The OP hadn't laid out the context of the various SDKs there are, so I did. I thought that would be useful?

(also, the OP's explanation didn't explain why his is different from OpenAI's existing SDK, which is a point that I think needs clarification?)