You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Failed to read thread goal: thread/goal/get failed in TUI #20841
Did you move all of the logs_2 files including the logs_2.sqlite-wal and logs_2.sqlite-shm sidecars? The latest log you uploaded hints at having inconsistent db state. Try moving all of those files to backup.
Did you move all of the logs_2 files including the logs_2.sqlite-wal and logs_2.sqlite-shm sidecars? The latest log you uploaded hints at having inconsistent db state. Try moving all of those files to backup.
Thanks it resolved the issue. For whoever hit this problem, I moved logs_2.sqlite* and state_5.sqlite* to backup folders.
I do not see the exact app-server init signal above, so adding it here. The confusing part is that
the TUI points at thread/goal/get, while the actionable failure is state runtime initialization. In
this case, the blocking DB was logs_2.sqlite*, not only state_5.sqlite*.
Suggested product-side fix: surface the state-runtime migration error in the TUI, include the failing
DB name, and document recovery for both state_5.sqlite* and logs_2.sqlite*, including -wal and -shm sidecars.
The next version (0.131.0) addresses this issue by detecting sqlite corruption and lock contention at launch time rather than allowing these conditions to appear later (e.g. when creating a goal).
Just adding that I encountered this issue, but it was caused by multiple Codex processes running and not fully closed. After I closed the other processes, the issue went away.
even with the latest version (codex-cli 0.130.0) I have the same issue. (Failed to read thread goal: thread/goal/get failed in TUI)
I just ran into this issue so am here too. In #20591, etraut-openai suggests moving ~/.codex/state_5.sqlite and restarting. Worked for me. He said that 0.131.0 will fix this issue. They just haven't released the next update yet. The other possible issue is if you have a long /goal prompt, to put it in a file and just tell it to do what's in the file.
I fixed this issue by asking Codex to find problem in logs. Codex found in logs_2.sqlite that goals feature is disabled and executed by adding goals = true into config.toml. now everything works fine
Activity
github-actions commentedon May 3, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
txtttx commentedon May 3, 2026
@etraut-openai Thanks for the suggestion. I tried to move state_5.sqlite to state_5.sqlite_backup and let it rebuild. But it doesn't help
etraut-openai commentedon May 3, 2026
OK, thanks for trying. I'm investigating your logs (thanks for uploading!) and that's hinting at a problem with the
logs_2.sqlitefile.txtttx commentedon May 3, 2026
Thanks for the suggestion. I moved logs_2.sqlite to backup. Codex can start up much faster, but I still hit the TUI bug.
New thread ID: 019debf3-7108-78c1-97af-8b3dfdb48951
etraut-openai commentedon May 3, 2026
Did you move all of the
logs_2files including the logs_2.sqlite-wal and logs_2.sqlite-shm sidecars? The latest log you uploaded hints at having inconsistent db state. Try moving all of those files to backup.txtttx commentedon May 3, 2026
Thanks it resolved the issue. For whoever hit this problem, I moved logs_2.sqlite* and state_5.sqlite* to backup folders.
Dhi13man commentedon May 16, 2026
Additional 0.130.0 Linux signal
Confirming the same failure still occurs on Linux with
codex-cli 0.130.0andgoals experimental true.The useful reproducer was:
That exposed the underlying init failure:
Local isolation:
state_5.sqlite*did not clear the migration error.logs_2.sqlite*too cleared the state runtime failure.backfill_state.status = completethreadsPRAGMA integrity_checkreturnedokfor the recreated state and logs DBsFailure mapping:
flowchart TD Start([TUI starts]) --> Init[Init StateRuntime] Init --> StateDb[Open state_5.sqlite] StateDb --> LogsDb[Open logs_2.sqlite] LogsDb --> Check{Migration checksum valid?} Check -->|No| NoHandle[State handle missing] NoHandle --> GoalGet[Call thread goal get] GoalGet --> Error[Show goal read failure] Check -->|Yes| Backfill[Backfill sessions] Backfill --> Goals[Goal reads work]I do not see the exact
app-serverinit signal above, so adding it here. The confusing part is thatthe TUI points at
thread/goal/get, while the actionable failure is state runtime initialization. Inthis case, the blocking DB was
logs_2.sqlite*, not onlystate_5.sqlite*.Suggested product-side fix: surface the state-runtime migration error in the TUI, include the failing
DB name, and document recovery for both
state_5.sqlite*andlogs_2.sqlite*, including-waland-shmsidecars.etraut-openai commentedon May 16, 2026
The next version (0.131.0) addresses this issue by detecting sqlite corruption and lock contention at launch time rather than allowing these conditions to appear later (e.g. when creating a goal).
BadAtCaptchas commentedon May 16, 2026
Just adding that I encountered this issue, but it was caused by multiple Codex processes running and not fully closed. After I closed the other processes, the issue went away.
etraut-openai commentedon May 16, 2026
@rmcc3, thanks for the tip. Yes, the next version will detect this situation and recommend that you close other copies.
sriinnu commentedon May 18, 2026
even with the latest version (codex-cli 0.130.0) I have the same issue. (Failed to read thread goal: thread/goal/get failed in TUI)
darlingm commentedon May 18, 2026
I just ran into this issue so am here too. In #20591, etraut-openai suggests moving
~/.codex/state_5.sqliteand restarting. Worked for me. He said that 0.131.0 will fix this issue. They just haven't released the next update yet. The other possible issue is if you have a long/goalprompt, to put it in a file and just tell it to do what's in the file.n-WN commentedon May 21, 2026
Version 0.132.0 has a similar issue.
extsps commentedon May 22, 2026
I fixed this issue by asking Codex to find problem in logs. Codex found in logs_2.sqlite that goals feature is disabled and executed by adding goals = true into config.toml. now everything works fine
ench2 commentedon May 24, 2026
同时安装了codex cli 与 codex app 导致的,我让codex 自己成功修复并找出原因
Failed to read thread goal: thread/goal/get failed in TUI
底层日志是:
no such table: thread_goals
所以不是 cad_viewer 项目代码导致的,也不是 SQLite 损坏。根因是 新旧 Codex 同时使用同一份用户数据目录,但它们对 goal 表的位置预期不同。
另外日志里那些 401/403、token invalidated、插件列表加载失败,不是 /goal 失败的直接原因。直接原因就是 state_5.sqlite 里旧版 TUI 要读的 thread_goals 表被新版本迁移删除了。