invalid type: sequence, expected struct HooksToml - Codex
Quick fix
Back up and delete the old config.toml so Codex regenerates a default config, fixing the incompatible hooks format.
Symptom
Section titled “Symptom”invalid type: sequence, expected struct HooksTomlThe Codex user config file format is incompatible with the current version. Older configs have `hooks` as an array (`hooks = [...]`) while the newer program requires a struct (`[hooks]`). A TOML parse failure interrupts application initialisation, which on Windows surfaces as a misleading permissions or incomplete-install error. Note: this issue cluster was aggregated wrongly because every member contains a GitHub image upload failure comment (`Failed to upload`), so it also mixes in model context limit problems during hot switching and abnormal GLM model output. This page covers only the config.toml parse failure.
Back up your existing config file so nothing is lost.
Change the `hooks` format to a struct, or simply delete the old config file.
$env:USERPROFILE\.codex\config.toml hooks = [...][hooks]...Quit ChatGPT/Codex completely and restart. If you deleted the config, the app generates a new default one automatically.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 4 real issues
- Why does this page reference other issues such as model context limits or abnormal output?
- All of those issues contained the GitHub-generated `<!-- Failed to upload "xxx.png" -->` comment, so the clustering algorithm grouped them as one problem. This page only resolves the `config.toml` parse failure.
- Can I fix it by hand rather than resetting the config?
- Yes. Open `config.toml` and change the old array format `hooks = [...]` into the struct format `[hooks]` the new version requires.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.