codex cli stops execution in the middle of a task

Resolved 💬 4 comments Opened Sep 10, 2025 by FarrukhCyber Closed Dec 23, 2025

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<Polynomial>" }

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<Polynomial>"
}

[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
<reasoning>We need to read files</reasoning><reasoning>{
"command": ["bash</reasoning><reasoning>", "-lc", "ls -R"] ,
"timeout_ms": 10000</reasoning>
[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<Coeff>,
}
impl Polynomial {
pub fn new(coeffs: Vec<Coeff>) -> 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
<reasoning>Oops duplication. Let's list relevant rust</reasoning><reasoning>{
"command": ["bash", "-lc", "sed</reasoning><reasoning> -n '1,200p' rust_aces/src/interfaces/polynomial.rs"] ,
"timeout</reasoning>
[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
<reasoning>We saw sub</reasoning><reasoning> is unimplemented. Need to implement based on C poly_sub.</reasoning><reasoning>{
"</reasoning><reasoning>command": ["bash", "-lc", "sed -n '1,200p' c_aces/src/Polynomial.c"] ,
</reasoning>
[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
<reasoning>The function poly_sub logic:
</reasoning><reasoning>- check size constraints and mod zero

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

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

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

Implementation similar to add but subtract.

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

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

Additional information

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

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗