invalid_request_error after any prompt in some conversations
Resolved 💬 4 comments Opened Mar 19, 2026 by andrew-valon Closed Aug 3, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
0.115.0
What subscription do you have?
Enterprise
Which model were you using?
gpt-5.4
What platform is your computer?
Darwin 25.3.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Cursor
What issue are you seeing?
■ {
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "[StringParam] [input[71].name] [invalid_string] Invalid 'input[71].name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-
Z0-9_-]+$'."
},
"status": 400
}
Seeing this after every prompt in some conversations. Incredibly confusing and impossible to debug.
What steps can reproduce the bug?
Uploaded thread: 019d0714-ff5b-72b1-88d0-c4048635ac89
What is the expected behavior?
_No response_
Additional information
_No response_
4 Comments
Do you have any experimental features enabled? If so, this is the likely explanation for why you're seeing this.
hey @etraut-openai -- which one is causing this to happen?
a quick update @etraut-openai - here's the problem more concretely specified, with a note about mitigation:
I found what looks like the same class of failure locally, although in my case the rejected field is
input[].namespacerather thaninput[].name.The symptom matches this issue: after a conversation contains the bad historical item, every later prompt in that conversation fails before the model runs because the old item is replayed into the next
response.create.In my trace DB, the failing websocket request was:
The rejected historical input item was:
The server response was:
In my local checkout, the immediate source appears to be the memory extension namespace constant:
That value is used to build a Responses API namespace tool spec in
ext/memories/src/tools/mod.rs. The trailing slash is invalid under the current API regex. The path is gated bymemories.dedicated_tools, which defaults tofalse, so this is likely an opt-in path, but once one of these calls exists in conversation history, disabling the tool path does not repair the already-contaminated thread.This may explain why the original report sees the error “after every prompt in some conversations”: the problem is not necessarily the new prompt, but a prior
function_callitem being replayed into each new request.Suggested fixes:
input[]function/tool identifiers client-side before websocket submission and report the offending index locally.^[A-Za-z0-9_-]+$.memories/to an API-valid namespace such asmemories.The key point is that fixing only future tool emission may not recover existing affected conversations unless replayed history is also normalized or filtered.
good news! this was fixed in PR #24898. Thanks @jif-oai
This can almost certainly be closed now, but I do not have those permissions.