Open Codex resubmits tool results after SIGINT cancellation
Summary
Severity / performance impact: High. A cancellation window can still leave Open Codex processing and resubmitting late tool results until timeout.
Affected target
- Target:
Open Codex
- Version/build:
open-codex 0.1.31
- Environment: Linux x86_64 Docker, public package build
- Provider/model: OpenAI-compatible local mock provider,
gpt-4
Steps to reproduce
Prerequisites: Docker, Python 3, and the GitHub CLI (gh) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It builds the affected CLI version from the public package registry, starts a local mock provider, and runs the CLI in an isolated workspace. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.
Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/6d8f653892d5cbc862e897e9ce1de459
The Gist contains open-codex-late-effects-after-cancel.reproduce.py. Download and run:
gh gist clone 6d8f653892d5cbc862e897e9ce1de459 open-codex-late-effects-after-cancel-reproducer
cd open-codex-late-effects-after-cancel-reproducer
python3 open-codex-late-effects-after-cancel.reproduce.py
To reuse an already-built local image:
python3 open-codex-late-effects-after-cancel.reproduce.py --skip-build
Expected successful reproduction output includes:
Actual behavior
The reproducer sends SIGINT while the provider stream is delayed, then emits a shell tool call. Reproduction succeeds when Open Codex repeatedly submits the late tool result and exits via timeout/signal handling.
Expected behavior
Open Codex should stop consuming late provider tool calls after cancellation and exit promptly with a bounded cancellation result.
Public-upstream status
This reproduces against stock public open-codex@0.1.31 built from npm.
Open Codex resubmits tool results after SIGINT cancellation
Summary
Severity / performance impact: High. A cancellation window can still leave Open Codex processing and resubmitting late tool results until timeout.
Affected target
Open Codexopen-codex 0.1.31gpt-4Steps to reproduce
Prerequisites: Docker, Python 3, and the GitHub CLI (
gh) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It builds the affected CLI version from the public package registry, starts a local mock provider, and runs the CLI in an isolated workspace. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/6d8f653892d5cbc862e897e9ce1de459
The Gist contains
open-codex-late-effects-after-cancel.reproduce.py. Download and run:gh gist clone 6d8f653892d5cbc862e897e9ce1de459 open-codex-late-effects-after-cancel-reproducer cd open-codex-late-effects-after-cancel-reproducer python3 open-codex-late-effects-after-cancel.reproduce.pyTo reuse an already-built local image:
Expected successful reproduction output includes:
Actual behavior
The reproducer sends SIGINT while the provider stream is delayed, then emits a shell tool call. Reproduction succeeds when Open Codex repeatedly submits the late tool result and exits via timeout/signal handling.
Expected behavior
Open Codex should stop consuming late provider tool calls after cancellation and exit promptly with a bounded cancellation result.
Public-upstream status
This reproduces against stock public open-codex@0.1.31 built from npm.