Sort by "Last updated" broken in new ChatGPT macOS App

Open 💬 2 comments Opened Jul 10, 2026 by kingtistel
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

26.707.31428

What subscription do you have?

Business

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

After the last (auto-)update that also switched the app from "Codex" to "ChatGPT",
Selecting "Sort by" = "Last updated" does no longer sort projects by last updated!
<img width="428" height="491" alt="Image" src="https://github.com/user-attachments/assets/09edf3c2-5811-41a0-ae83-5c3365455b86" />

What steps can reproduce the bug?

Feedback ID: no-active-thread-019f4c39-72f3-7353-869a-afefc3567752

What is the expected behavior?

Selecting "Sort by" = "Last updated" will sort projects by last updated!

Additional information

It used to work perfectly well in previous "Codex" version!

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #31836
  • #31964
  • #31872

Powered by Codex Action

kingtistel · 1 month ago

After reading #31836
Using this script as a temporary W/A -- needs to be rerun after significant activity -- very inconvenient!

state="$HOME/.codex/.codex-global-state.json"
db="$HOME/.codex/state_5.sqlite"
tmp="$(mktemp "${TMPDIR:-/tmp}/codex-global-state.XXXXXX")"
trap 'rm -f "$tmp"' EXIT

cp -n "$state" "$state.before-31836"

recency="$(sqlite3 -json "$db" '
  SELECT cwd, MAX(recency_at_ms) AS recency
  FROM threads
  WHERE archived = 0
  GROUP BY cwd;
')"

jq --argjson recency "$recency" '
  ($recency | map({key: .cwd, value: .recency}) | from_entries) as $r
  | .["project-order"] |= (
      to_entries
      | sort_by(-($r[.value] // 0), .key)
      | map(.value)
    )
  | .["electron-persisted-atom-state"]
      ["flat-project-sidebar-preferences-v1"] |=
      ((. // {}) + {
        initialized: true,
        mode: "project",
        projectSortMode: "updated_at"
      })
' "$state" > "$tmp" &&
mv "$tmp" "$state"

trap - EXIT