codex icon indicating copy to clipboard operation
codex copied to clipboard

codex cli stops execution in the middle of a task

Open FarrukhCyber opened this issue 1 year ago • 4 comments

What version of Codex is running?

0.33.0

Which model were you using?

gpt-oss-120b

What platform is your computer?

Linux 6.8.0-59-generic x86_64 x86_64

What steps can reproduce the bug?

  1. Run the codex using codex
  2. Provide the following prompt:

Role

You are a senior C → Rust migration engineer.

Task

Translate only given Rust function which will be equivalent to its already implemented C counterpart and confirm it compiles:

  1. Implement any missing helper functions that the target Rust functionrelies on.
  2. Implement the Rust function so it is functionally identical to the C original, using idiomatic, safe Rust.
  3. Run cargo check in the workspace root (rust_aces) and ensure zero errors.
  4. Do not modify any other files.
  5. If the target Rust function is already implemented, DO NOT modify it.
  6. MAKE SURE YOU UPDATE THE RELEVANT RUST FILE WITH THE NEW IMPLEMENTATION.

Target Pair

{ "c_module": "c_aces/src/Polynomial.c", "c_function": "poly_sub", "rust_module": "rust_aces/src/interfaces/polynomial.rs", "rust_function": "sub(&self, other: &Polynomial, modulus: u64) -> Result" }

What is the expected behavior?

It should update the relevant file, however it stops the execution while reasoning or running tools

What do you see instead?

Output: [2025-09-10T22:15:08] OpenAI Codex v0.33.0 (research preview)

workdir: /home/hexlab/Desktop/research_project_2 model: openai.gpt-oss-120b-1:0 provider: bedrock approval: never sandbox: workspace-write [workdir, /tmp, $TMPDIR]

[2025-09-10T22:15:08] User instructions:

### Role
You are a senior C → Rust migration engineer.

### Context
Follow *all* translation rules in `AGENTS.md`

### Task
Translate **only given Rust function** which will be equivalent to its already implemented C counterpart and confirm it compiles:

1. Implement any missing helper functions that the target Rust functionrelies on.  
2. Implement the Rust function so it is functionally identical to the C original, using idiomatic, safe Rust.  
3. Run `cargo check` in the workspace root (`rust_aces`) and ensure zero errors.  
4. Do **not** modify any other files.
5. If the target Rust function is already implemented, DO NOT modify it.
6. MAKE SURE YOU UPDATE THE RELEVANT RUST FILE WITH THE NEW IMPLEMENTATION.

### Target Pair
{

"c_module": "c_aces/src/Polynomial.c", "c_function": "poly_sub", "rust_module": "rust_aces/src/interfaces/polynomial.rs", "rust_function": "sub(&self, other: &Polynomial, modulus: u64) -> Result" }

[2025-09-10T22:15:09] exec bash -lc 'ls -R' in /home/hexlab/Desktop/research_project_2 [2025-09-10T22:15:09] bash -lc 'ls -R' succeeded in 19ms: .: AGENTS.md bedrock_inferecne.py c_aces c_fslib codex.log c_parser c_parser.py func_validator.py module_parser.py my_translate.py output_fslib.json output.json progress.json pycache README_bedrock.md README.md README_parser.md requirements.txt rust_aces [2025-09-10T22:15:09] codex We need to read files{ "command": ["bash", "-lc", "ls -R"] , "timeout_ms": 10000 [2025-09-10T22:15:11] exec bash -lc "sed -n '1,200p' rust_aces/src/interfaces/polynomial.rs" in /home/hexlab/Desktop/research_project_2 [2025-09-10T22:15:11] bash -lc "sed -n '1,200p' rust_aces/src/interfaces/polynomial.rs" succeeded in 18ms: use crate::error::Result; pub type Coeff = i64; #[derive(Debug, Clone, PartialEq, Eq)] pub struct Polynomial { pub coeffs: Vec, } impl Polynomial { pub fn new(coeffs: Vec) -> Self { Self { coeffs } } pub fn degree(&self) -> usize { // Return the degree of the polynomial (highest exponent with a non-zero coefficient). // Coefficients are stored from highest degree (index 0) to lowest. if self.coeffs.is_empty() { return 0; } for (i, &c) in self.coeffs.iter().enumerate() { if c != 0 { return self.coeffs.len() - i - 1; } [2025-09-10T22:15:11] codex Oops duplication. Let's list relevant rust{ "command": ["bash", "-lc", "sed -n '1,200p' rust_aces/src/interfaces/polynomial.rs"] , "timeout [2025-09-10T22:15:13] exec bash -lc "sed -n '1,200p' c_aces/src/Polynomial.c" in /home/hexlab/Desktop/research_project_2 [2025-09-10T22:15:13] bash -lc "sed -n '1,200p' c_aces/src/Polynomial.c" succeeded in 18ms: #include "include/Polynomial.h" #include "include/Common.h" #include <stdio.h> #include <stdlib.h> #include <string.h>

void poly_free(Polynomial *poly) { free(poly->coeffs); poly->coeffs = NULL; poly->size = 0; }

int get_polynomial(Polynomial *p, size_t size) { p->size = size; p->coeffs = (Coeff *)malloc(p->size * sizeof(Coeff)); if (p->coeffs == NULL) return -1; return 0; }

[2025-09-10T22:15:13] codex We saw sub is unimplemented. Need to implement based on C poly_sub.{ "command": ["bash", "-lc", "sed -n '1,200p' c_aces/src/Polynomial.c"] , [2025-09-10T22:15:16] exec bash -lc "sed -n '1,200p' rust_aces/src/error.rs" in /home/hexlab/Desktop/research_project_2 [2025-09-10T22:15:16] bash -lc "sed -n '1,200p' rust_aces/src/error.rs" exited 2 in 19ms: sed: can't read rust_aces/src/error.rs: No such file or directory [2025-09-10T22:15:16] codex The function poly_sub logic: - check size constraints and mod zero

  • if sizes differ: diff1, diff2, loop over result size, compute (i >= diff1 ? poly1->coeffs[i - diff1] : 0) - (i >= diff2 ? poly2->coeffs[i - diff2] : 0) % mod
  • else simple elementwise subtraction.

The Rust version earlier for add uses similar logic with modulus handling and negative result handling.

In sub implementation, we need to produce Result. Return Err when mod==0 or other error? In C error returns -1 when size mismatch > result size or mod zero. In Rust version add returns Err if modulus zero. It doesn't check result size because result is newly created to larger size automatically. Sub should similar to add.

Implementation similar to add but subtract.

Let's inspect definition of Polynomial struct earlier. Implement sub similar to add but using subtraction and handling negative values.

Search for other functions for error definition{ "command": ["bash", "-lc", "sed -n '1,200p' rust_aces/src/error.rs"] , [2025-09-10T22:15:18] codex Let's list error module in rust_aces.<reasoning{ "command": ["bash", "-lc", "sed -n '1,200p' rust_aces/src/error.rs"] , "timeout_ms": 10000}

Additional information

I'm using codex-cli with gpt-oss-120b which is hosted on aws bedrock.

FarrukhCyber avatar Sep 10 '25 22:09 FarrukhCyber

I am experiencing similar behavior with codex exec and codex v0.42.0

tzanko-matev avatar Oct 02 '25 07:10 tzanko-matev

Me too in codex v0.46.0

eduardofacunha avatar Oct 16 '25 18:10 eduardofacunha

Me too in codex-cli 0.58.0

101scholar avatar Nov 16 '25 13:11 101scholar

This bug report is old and not actionable because there's not enough information to diagnose. If you see this behavior again, please use the /feedback slash command to upload the session and open a new bug report.

etraut-openai avatar Dec 23 '25 04:12 etraut-openai