TUI /goal fails when local goals SQLite database is malformed
Summary
Setting a thread goal in the interactive TUI fails immediately with:
Failed to set thread goal: thread/goal/set failed in TUI
The local goal-state SQLite database is malformed.
Environment
- Codex CLI
0.144.4 - Linux x64
- Standalone CLI installation
Reproduction
- Start a fresh Codex TUI session.
- Attempt to set a thread goal.
- Observe the error above.
The failure persisted after running codex doctor, fully restarting Codex, and running codex update (which installed 0.144.4).
Local diagnostic
A read-only SQLite integrity check against ~/.codex/goals_1.sqlite fails immediately:
sqlite3.DatabaseError: database disk image is malformed
The database has associated -wal and -shm files, and the Codex data directory contains prior automatic goal-database repair backups. I have not attached database files because they may contain sensitive thread metadata/content.
codex --version also prints a separate warning about inability to create PATH aliases because of a read-only filesystem; Codex otherwise starts normally. This may be unrelated.
Expected behavior
Codex should either recover a malformed goal database safely or provide a clear supported recovery action instead of surfacing only the generic TUI error.
Request
Please document or implement the supported recovery path: whether it is safe to preserve then remove/regenerate goals_1.sqlite along with its -wal and -shm sidecars, and whether any goal state can be migrated from automatic repair backups.