[Error]: 400 No tool output found for function
What version of Codex is running?
v0.1.2504221401
Which model were you using?
o4-mini
What platform is your computer?
Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 unknown
What steps can reproduce the bug?
I wrote a prompt describing few changes to my code and send to cli. After codex run and analysis some files of my code base I got this error:
file:///home/hugo/.nvm/versions/node/v22.14.0/lib/node_modules/@openai/codex/dist/cli.js:473),IS.set(this,void 0),o9.set(this,void 0),wS.set(this,"-".repeat(2)),Vg.set(this,new TextEncoder),RS.set(this,void 0),NS.set(this,void 0),s9.set(this,void 0),!mse(t))throw new TypeError("Expected first argument to be a FormData instance.");let a;if(R7(r)?n=r:a=r,a||(a=fse()),typeof a!="string")throw new TypeError("Expected boundary argument to be a string.");if(n&&!R7(n))throw new TypeError("Expected options argument to be an object.");TS(this,NS,t,"f"),TS(this,s9,{...mke,...n},"f"),TS(this,IS,ba(this,Vg,"f").encode(ba(this,Rf,"f")),"f"),TS(this,o9,ba(this,IS,"f").byteLength,"f"),this.boundary=form-data-boundary-${a},this.contentType=multipart/form-data; boundary=${this.boundary},TS(this,RS,ba(this,Vg,"f").encode(${ba(this,wS,"f")}${this.boundary}${ba(this,wS,"f")}${ba(this,Rf,"f").repeat(2)}),"f"),this.contentLength=String(this.getContentLength()),this.headers=Object.freeze({"Content-Type":this.contentType,"Content-Length":this.contentLength}),Object.defineProperties(this,{boundary:{writable:!1,configurable:!1},contentType:{writable:!1,configurable:!1},contentLength:{writable:!1,configurable:!1},headers:{writable:!1,configurable:!1}})}getContentLength(){let t=0;for(let[r,n]of ba(this,NS,"f")){let a=qg(n)?n:ba(this,Vg,"f").encode(N7(n));t+=ba(this,i9,"m",O7).call(this,r,a).byteLength,t+=qg(a)?a.size:a.byteLength,t+=ba(this,o9,"f")}return t+ba(this,RS,"f").byteLength}*values(){for(let[t,r]of ba(this,NS,"f").entries()){let n=qg(r)?r:ba(this,Vg,"f").encode(N7(r));yield ba(this,i9,"m",O7).call(this,t,n),yield n,yield ba(this,IS,"f")}yield ba(this,RS,"f")}async*encode(){for(let t of this.values())qg(t)?yield*t.stream():yield t}[(Rf=new WeakMap,IS=new WeakMap,o9=new WeakMap,wS=new WeakMap,Vg=new WeakMap,RS=new WeakMap,NS=new WeakMap,s9=new WeakMap,i9=new WeakSet,O7=function(r,n){let a="";return a+=${ba(this,wS,"f")}${this.boundary}${ba(this,Rf,"f")},a+=Content-Disposition: form-data; name="${x7(r)}",qg(n)&&(a+=; filename="${x7(n.name)}"${ba(this,Rf,"f")},a+=Content-Type: ${n.type||"application/octet-stream"}),ba(this,s9,"f").enableAdditionalHeaders===!0&&(a+=${ba(this,Rf,"f")}Content-Length: ${qg(n)?n.size:n.byteLength}),ba(this,Vg,"f").encode(${a}${ba(this,Rf,"f").repeat(2)})},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};m();m();import{Readable as bke}from"node:stream";m();var c9=class{constructor(t){this.body=t}get[Symbol.toStringTag](){return"MultipartBody"}};import{ReadableStream as vke}from"node:stream/web";var vse=!1;async function Tke(e,...t){let{fileFromPath:r}=await Promise.resolve().then(()=>(bse(),Dse));return vse||(console.warn(fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(e)}) instead),vse=!0),await r(e,...t)}var Ike=new k7.default({keepAlive:!0,timeout:5*60*1e3}),wke=new k7.default.HttpsAgent({keepAlive:!0,timeout:5*60*1e3});async function Rke(e,t){let r=new l9(e),n=bke.from(r),a=new c9(n),i={...t.headers,...r.headers,"Content-Length":r.contentLength};return{...t,body:a,headers:i}}function Ise(){return typeof AbortController>"u"&&(globalThis.AbortController=Tse.AbortController),{kind:"node",fetch:Nf.default,Request:Nf.Request,Response:Nf.Response,Headers:Nf.Headers,FormData:Z4,Blob:Id,File:uu,ReadableStream:vke,getMultipartRequestOptions:Rke,getDefaultAgent:e=>e.startsWith("https")?wke:Ike,fileFromPath:Tke,isFsReadStream:e=>e instanceof Dke}}var F7=()=>{kg||wae(Ise(),{auto:!0})};F7();m();var qt=class extends Error{},Si=class e extends qt{constructor(t,r,n,a){super(${e.makeMessage(t,r,n)}),this.status=t,this.headers=a,this.request_id=a?.["x-request-id"],this.error=r;let i=r;this.code=i?.code,this.param=i?.param,this.type=i?.type}static makeMessage(t,r,n){let a=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return t&&a?${t} ${a}:t?${t} status code (no body):a||"(no status code or body)"}static generate(t,r,n,a){if(!t||!a)return new n1({message:n,cause:u9(r)});let i=r?.error;return t===400?new w0(t,i,n,a):t===401?new R0(t,i,n,a):t===403?new N0(t,i,n,a):t===404?new x0(t,i,n,a):t===409?new O0(t,i,n,a):t===422?new B0(t,i,n,a):t===429?new k0(t,i,n,a):t>=500?new F0(t,i,n,a):new e(t,i,n,a)}},ci=class extends Si{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},n1=class extends Si{constructor({message:t,cause:r}){super(void 0,void 0,t||"Connection error.",void 0),r&&(this.cause=r)}},pu=class extends n1{constructor({message:t}={}){super({message:t??"Request timed out."})}},w0=class extends Si{},R0=class extends Si{},N0=class extends Si{},x0=class extends Si{},O0=class extends Si{},B0=class extends Si{},k0=class extends Si{},F0=class extends Si{},L0=class extends qt{constructor(){super("Could not parse response content as the length limit was reached")}},M0=class extends qt{constructor(){super("Could not parse response content as the request was rejected by the content filter")}};m();var d9=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},$g=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Nl,Kg=class{constructor(){Nl.set(this,void 0),this.buffer=new Uint8Array,d9(this,Nl,null,"f")}decode(t){if(t==null)return[];let r=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?new TextEncoder().encode(t):t,n=new Uint8Array(this.buffer.length+r.length);n.set(this.buffer),n.set(r,this.buffer.length),this.buffer=n;let a=[],i;for(;(i=xke(this.buffer,$g(this,Nl,"f")))!=null;){if(i.carriage&&$g(this,Nl,"f")==null){d9(this,Nl,i.index,"f");continue}if($g(this,Nl,"f")!=null&&(i.index!==$g(this,Nl,"f")+1||i.carriage)){a.push(this.decodeText(this.buffer.slice(0,$g(this,Nl,"f")-1))),this.buffer=this.buffer.slice($g(this,Nl,"f")),d9(this,Nl,null,"f");continue}let o=$g(this,Nl,"f")!==null?i.preceding-1:i.preceding,c=this.decodeText(this.buffer.slice(0,o));a.push(c),this.buffer=this.buffer.slice(i.index),d9(this,Nl,null,"f")}return a}decodeText(t){if(t==null)return"";if(typeof t=="string")return t;if(typeof Buffer<"u"){if(t instanceof Buffer)return t.toString();if(t instanceof Uint8Array)return Buffer.from(t).toString();throw new qt(Unexpected: received non-Uint8Array (${t.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.)}if(typeof TextDecoder<"u"){if(t instanceof Uint8Array||t instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(t);throw new qt(Unexpected: received non-Uint8Array/ArrayBuffer (${t.constructor.name}) in a web platform. Please report this error.)}throw new qt("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){return this.buffer.length?this.decode(
w0 [Error]: 400 No tool output found for function call call_jJC7QS0vAwRo40SXGnDM6LSo.
at e.generate (file:///home/hugo/.nvm/versions/node/v22.14.0/lib/node_modules/@openai/codex/dist/cli.js:473:4010)
at Rr.makeStatusError (file:///home/hugo/.nvm/versions/node/v22.14.0/lib/node_modules/@openai/codex/dist/cli.js:477:7623)
at Rr.makeRequest (file:///home/hugo/.nvm/versions/node/v22.14.0/lib/node_modules/@openai/codex/dist/cli.js:477:8555)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async fE.run (file:///home/hugo/.nvm/versions/node/v22.14.0/lib/node_modules/@openai/codex/dist/cli.js:493:198) {
status: 400,
headers: {
'alt-svc': 'h3=":443"; ma=86400',
'cf-cache-status': 'DYNAMIC',
'cf-ray': '935653248ab84d35-GRU',
connection: 'keep-alive',
'content-length': '184',
'content-type': 'application/json',
date: 'Thu, 24 Apr 2025 14:35:02 GMT',
'openai-organization': 'somateste',
'openai-processing-ms': '998',
'openai-version': '2020-10-01',
server: 'cloudflare',
'set-cookie': '__cf_bm=yYAlCo_voaLGuvDEjtCuiZGKeXL5CbyWH2VDFKNSCi8-1745505302-1.0.1.1-omV_Fqa9mqyKd5fmFW5K_x3Rdp3Q8Z8je2Ccnm6pND9.WNuep5B9PDM_6D2t2miK_H3IoVDzbpWHft55lcTurdtUtFKjF2sB0cDMGdomsik; path=/; expires=Thu, 24-Apr-25 15:05:02 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None, _cfuvid=1LdhlwlxY9p_lodoRRYWfpQQAMw8jwVC4Di2NqXz6gc-1745505302371-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None',
'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
'x-content-type-options': 'nosniff',
'x-request-id': 'req_1ae88b9f402774c49d3df42f9a46d0ae'
},
request_id: 'req_1ae88b9f402774c49d3df42f9a46d0ae',
error: {
message: 'No tool output found for function call call_jJC7QS0vAwRo40SXGnDM6LSo.',
type: 'invalid_request_error',
param: 'input',
code: null
},
code: null,
param: 'input',
type: 'invalid_request_error'
}
Node.js v22.14.0
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
8 Comments
This happens to me any time I interrupt Codex while it is waiting for the response from a tool call. Forces a restart of the CLI.
Check if you see "Rate limit reached" errors in your OpenAI logs and if so, this recently merged PR should fix the issue: https://github.com/openai/codex/pull/611
Thats right, I got this error message in logs
I'm still having this issue. I've had it twice now (today). What I've observed was in both cases, the conversation had dropped below 50% context left, with both failing at 48% context. Is this possibly related to conversation handling?
I am getting this for every codex prompt. it is consuming input tokens but I get nothing back :(
!Image
I am also getting this issue using o3
Getting this mostly when Codex thinks for >300s.
Thank you for the feedback! Please try using the latest version of Codex CLI to see if the issue persists. If it does, feel free to report back.