retry error across most gemini models

Resolved 💬 1 comment Opened Apr 23, 2025 by mcjdh Closed Apr 25, 2025

What version of Codex is running?

0.1.2504221401

Which model were you using?

gemini-1.5-pro-latest

What platform is your computer?

linux | arm64 | 6.12.20+rpt-rpi-v8

What steps can reproduce the bug?

  • ```

hello
```

  • 1 reasoning | 0 tool
  • ```

do you see the index.html?
```

  • 1 reasoning | 0 tool
  • ```

explore it to learn what it is
```

  • 0 reasoning | 1 tool

What is the expected behavior?

running codex in full auto with gemini provider, looking for a standard back and fourth file creation, management, editing, etc.

What do you see instead?

on running gemini models, sometimes they work, other times they will error and crash out, on asking things like what is this file, create a template index.html, hello, etc. models tested 1.5, 2.0 flash, 2.5, etc.

debug shows this error when it crashes on any of the models:

OpenAI:DEBUG:response (error; (error; no more retries left)) 400 https://generativelanguage.googleapis.com/v1beta/openai/chat/completions {
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
'content-encoding': 'gzip',
'content-type': 'application/json; charset=UTF-8',
date: 'Wed, 23 Apr 2025 23:32:26 GMT',
server: 'scaffolding on HTTPServer2',
'server-timing': 'gfet4t7; dur=4',
'transfer-encoding': 'chunked',

Additional information

another crash instance:

user
what is the index.html file in the current workdir
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│( ● ) 0s Thinking. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
send q or ctrl+c to exit | send "/clear" to reset | send "/help" for commands | press enter to send | shift+enter for new line — 100% context left

OpenAI:DEBUG:response 200 https://generativelanguage.googleapis.com/v1beta/openai/chat/completions e [Headers] {
[Symbol(map)]: [Object: null prototype] {
'content-type': [ 'text/event-stream' ],
vary: [ 'Origin, X-Origin, Referer' ],
'content-encoding': [ 'gzip' ],
date: [ 'Wed, 23 Apr 2025 23:36:33 GMT' ],
server: [ 'scaffolding on HTTPServer2' ],
'x-xss-protection': [ '0' ],
'x-frame-options': [ 'SAMEORIGIN' ],
'x-content-type-options': [ 'nosniff' ],
'server-timing': [ 'gfet4t7; dur=786' ],
'alt-svc': [ 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000' ],
'transfer-encoding': [ 'chunked' ]
}
} <ref *1> Gunzip {
_writeState: Uint32Array(2) [ 0, 0 ],
_events: {
close: [Function: bound onceWrapper] { listener: [Function: onclose] },
error: [ [Function: onerror], [Function (anonymous)] ],
prefinish: [Function: prefinish],
finish: [Function: bound onceWrapper] { listener: [Function: onfinish] },
drain: undefined,
data: undefined,
end: undefined,
readable: undefined,
unpipe: [Function: onunpipe]
},
_readableState: ReadableState {
highWaterMark: 65536,
buffer: [],
bufferIndex: 0,
length: 0,
pipes: [],
awaitDrainWriters: null,
[Symbol(kState)]: 1048844
},
_writableState: WritableState {
highWaterMark: 65536,
length: 223,
corked: 0,
onwrite: [Function: bound onwrite],
writelen: 1,
bufferedIndex: 0,
pendingcb: 3,
[Symbol(kState)]: 621592844,
[Symbol(kBufferedValue)]: [ [Object], [Object] ]
},
allowHalfOpen: true,
_maxListeners: undefined,
_eventsCount: 5,
bytesWritten: 0,
_handle: Zlib {
onerror: [Function: zlibOnError],
buffer: <Buffer 1f>,
cb: [Function (anonymous)],
availOutBefore: 16384,
availInBefore: 1,
inOff: 0,
flushFlag: 2,
[Symbol(owner_symbol)]: [Circular *1]
},
_outBuffer: <Buffer 60 12 5e 8b 7f 00 00 00 60 12 5e 8b 7f 00 00 00 00 3d 13 46 00 00 00 00 00 3d 13 46 00 00 00 00 2d 54 79 70 65 3a 20 74 65 78 74 2f 65 76 65 6e 74 2d ... 16334 more bytes>,
_outOffset: 0,
_chunkSize: 16384,
_defaultFlushFlag: 2,
_finishFlushFlag: 2,
_defaultFullFlushFlag: 3,
_info: undefined,
_maxOutputLength: 9007199254740991,
_level: -1,
_strategy: 0,

command

$ cat index.html
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│( ● ) 0s Thinking. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
send q or ctrl+c to exit | send "/clear" to reset | send "/help" for commands | press enter to send | shift+enter for new line — 100% context left

OpenAI:DEBUG:request https://generativelanguage.googleapis.com/v1beta/openai/chat/completions {
method: 'post',
path: '/chat/completions',
body: {
model: 'gemini-1.5-pro-latest',
messages: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
tools: [ [Object] ],
web_search_options: undefined,
temperature: 1,
top_p: 1,
tool_choice: 'auto',
stream: true,
user: undefined,
metadata: undefined
},
stream: true
} {
'content-length': '15803',
accept: 'application/json',
'content-type': 'application/json',
'user-agent': 'Rr/JS 4.95.1',
'x-stainless-lang': 'js',
'x-stainless-package-version': '4.95.1',
'x-stainless-os': 'Linux',
'x-stainless-arch': 'arm64',
'x-stainless-runtime': 'node',
'x-stainless-runtime-version': 'v22.14.0',
authorization: 'REDACTED',
originator: 'codex_cli_ts',

command.stdout (code: 0, duration: 0s)

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
... (255 more lines)
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│( ● ) 0s Thinking. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
send q or ctrl+c to exit | send "/clear" to reset | send "/help" for commands | press enter to send | shift+enter for new line — 98% context left

OpenAI:DEBUG:response (error; (error; no more retries left)) 400 https://generativelanguage.googleapis.com/v1beta/openai/chat/completions {
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
'content-encoding': 'gzip',
'content-type': 'application/json; charset=UTF-8',
date: 'Wed, 23 Apr 2025 23:36:33 GMT',
server: 'scaffolding on HTTPServer2',
'server-timing': 'gfet4t7; dur=2',
'transfer-encoding': 'chunked',

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗