VS Code Codex send fails when persisted prompt-history is not an array
What version of the IDE extension are you using?
openai.chatgpt 26.429.30905
What subscription do you have?
ChatGPT Pro
Which IDE are you using?
VS Code on macOS, connected to Ubuntu via Remote SSH
What platform is your computer?
Darwin 25.3.0 arm64 arm
What issue are you seeing?
The Codex VS Code extension send action fails before the request is sent.
When I type a prompt such as 123 and click Send, or press Enter, the UI appears to do nothing. The
Codex Webview DevTools console shows:
```text
composer-DCiWkR6u.js:119 Uncaught (in promise) TypeError: n is not iterable
at u (composer-DCiWkR6u.js:119:45357)
at ns (composer-DCiWkR6u.js:220:12188)
at onSubmit (composer-DCiWkR6u.js:220:18850)
at use-model-settings-DI3cK46E.js:1942:39621
at Set.forEach (<anonymous>)
at hve.emit (use-model-settings-DI3cK46E.js:1942:39610)
at Enter (use-model-settings-DI3cK46E.js:1942:40807)
I also saw telemetry/network errors like Sentry 429 Too Many Requests and Statsig 403 Forbidden, but
those appear secondary. The blocking error is TypeError: n is not iterable.
Root cause hypothesis: the composer submit path appends the submitted prompt to persisted prompt history
before sending the request. The compiled Webview bundle contains logic equivalent to:
let t = [...n, e]
If the persisted prompt-history value is not an array, this throws before the actual submit request is
sent. That makes the Send button appear unresponsive.
What steps can reproduce the bug?
- Install and open the Codex VS Code extension.
- Use VS Code on macOS connected to an Ubuntu machine via Remote SSH.
- Open the Codex Webview Developer Tools.
- In the Codex Webview frame, simulate invalid persisted prompt history:
``js``
localStorage.setItem(
"codex:persisted-atom:prompt-history",
JSON.stringify({ invalid: true })
);
location.reload();
- Type a prompt, for example:
````
123
- Click Send or press Enter.
Actual result: the Webview console throws:
TypeError: n is not iterable
The request is not sent.
What is the expected behavior?
Invalid or corrupted persisted prompt history should not prevent message submission.
The extension should either ignore/reset invalid prompt-history state or normalize it before use. For
example:
``js``
const history = Array.isArray(promptHistory) ? promptHistory : [];
const nextHistory = [...history, prompt];
Clicking Send or pressing Enter should still send the prompt even if persisted prompt history is
malformed.
Additional information
Remote server platform:
``text`
Linux 6.8.0-101-generic x86_64 x86_64
`
Remote extension path:
``
~/.vscode-server/extensions/openai.chatgpt-26.429.30905-linux-x64
I verified a local workaround by patching the compiled Webview bundle:
- let t = [...n, e]
- let t = [...(Array.isArray(n) ? n : []), e]
After reloading VS Code, sending worked again.
This was only a local workaround and will be overwritten by extension updates or reinstalls. The
suggested upstream fix is to validate/migrate persisted prompt-history so non-array values are reset to
[].
I also saw this warning in the logs:
PendingMigrationError: navigator is now a global in nodejs
but the specific send failure was resolved by guarding the prompt history array usage.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗