fix: gracefully handle unsupported thread/name/set on older Codex CLI#126
Merged
dkundel-openai merged 2 commits intoopenai:mainfrom Apr 8, 2026
Merged
Conversation
Codex CLI v0.118.0 does not recognize the thread/name/set JSON-RPC method, causing startThread() to throw. Thread naming is cosmetic (for job log labels) and should not block thread creation. Wraps the call in try/catch so it fails silently on older CLI versions. Fixes openai#119
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc597ce527
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Address Codex review feedback: the bare catch swallowed all errors including auth, network, and server failures. Now only suppresses errors containing 'unknown variant' or 'unknown method' (the specific error older CLI versions return) and rethrows everything else.
|
🦀 Assigned! I will submit a PR for this issue. Looking at the fix now. |
Contributor
Author
@D2758695161 please stop automating things, you're looking at PRs proposing PRs. |
dkundel-openai
approved these changes
Apr 8, 2026
Contributor
Author
|
@dkundel-openai thanks for the merge! |
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.
Summary
startThread()incodex.mjscallsthread/name/setunconditionally, which throws on Codex CLI v0.118.0 because that version doesn't support the method. This wraps the call in a try/catch so thread creation succeeds even when naming is unsupported.Changes
One file:
plugins/codex/scripts/lib/codex.mjs, functionstartThread()(line 639-645).Thread naming is cosmetic (used for job log labels) and should not prevent thread creation. The try/catch allows the plugin to work with both older and newer Codex CLI versions.
Testing
npm test: same results as main (pre-existing failures in commands.test.mjs, unrelated)npm run build: passesThis contribution was developed with AI assistance (Codex).
Fixes #119