Repository navigation
fix(runtime): import AsyncCodex from openai_codex, not codex_app_server - #591
Merged
Merged
Conversation
The codex runtime imported `from codex_app_server import AsyncCodex`, but that package does not exist on PyPI (404). The OpenAI Codex Python SDK publishes the symbol as `openai_codex.AsyncCodex` (pip install openai-codex), whose API matches our usage (AsyncCodex() context manager -> thread_start(model=...) -> thread.run(prompt)). Fix the import and the dependency hints. openai-codex bundles the Codex CLI binary via its openai-codex-cli-bin dependency, so no separate binary / PATH setup is needed — pip install is enough. Verified end-to-end: the runtime now reaches a live model turn.
zakahan
approved these changes
Jun 9, 2026
PolarisCzh
pushed a commit
to PolarisCzh/veadk-python
that referenced
this pull request
Sep 23, 2026
…er (volcengine#591) The codex runtime imported `from codex_app_server import AsyncCodex`, but that package does not exist on PyPI (404). The OpenAI Codex Python SDK publishes the symbol as `openai_codex.AsyncCodex` (pip install openai-codex), whose API matches our usage (AsyncCodex() context manager -> thread_start(model=...) -> thread.run(prompt)). Fix the import and the dependency hints. openai-codex bundles the Codex CLI binary via its openai-codex-cli-bin dependency, so no separate binary / PATH setup is needed — pip install is enough. Verified end-to-end: the runtime now reaches a live model turn.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Agent(runtime="codex")fails at import:veadk/runtime/codex/runtime.pyimportedfrom codex_app_server import AsyncCodex, butcodex_app_serverdoes not exist on PyPI (404). The OpenAI Codex Python SDK publishes the symbol asopenai_codex.AsyncCodex(pip install openai-codex).Fix
AsyncCodexfromopenai_codex. Its API matches our existing usage unchanged:async with AsyncCodex()→thread_start(model=...)→await thread.run(prompt).get_runtimeerror message to point at the real package.Pure-pip, no binary setup
openai-codexdepends onopenai-codex-cli-bin, which ships the Codex CLI binary as a platform wheel (installed undersite-packages/codex_cli_bin/bin/). The SDK locates it automatically — no npm/brew/PATH setup required. The runtime's other deps (fastapi,uvicorn) are unchanged.Install:
Verification
With
openai-codexinstalled, a minimalAgent(runtime="codex")run now executes end-to-end through the runtime — loads the bundled binary, starts a thread, and reaches a live model turn (the only remaining error observed was a transient upstream "high demand" from the bridged model backend, not a code/setup issue).ruff check + format pass (pre-commit).