Codex SDK: Add abort() / cancel() method to stop active thread.run(...) calls
Resolved 💬 1 comment Opened Oct 22, 2025 by OhadAssulin Closed Jan 14, 2026
What feature would you like to see?
Currently, the Codex TypeScript SDK (sdk/typescript/src/thread.ts) does not provide a way to cancel or abort an active thread.run(...) operation once it has started. This creates issues in scenarios where the run may take longer than expected, hang, or needs to be stopped due to changing user input or application logic.
A native abort() or cancel() method would allow developers to gracefully stop ongoing runs, improving both control and UX for interactive applications.
Desired Behavior
Provide an API method to terminate a running operation. For example:
const thread = codex.startThread();
const run = thread.run("Generate code...");
// later:
thread.abort(); // or run.abort()
This should:
• Stop the underlying Codex process / stream
• Reject the pending promise
Additional information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗