Skip to content

Detect oversized Codex thread titles and suggest repair #3

Description

@clairernovotny

Problem

Codex Desktop can become sluggish when the local threads.title values in ~/.codex/state_5.sqlite grow very large. I hit a case where RepoPrompt/ACP-created Codex sessions had title equal to the full first user message, including a long <codex reminder>... prompt. Switching chats became noticeably slow.

In the local incident:

  • active threads.title text totaled about 14.6M chars
  • 39 active titles were over 100KB
  • 56 active RepoPrompt/ACP-looking rows had title exactly equal to first_user_message
  • the largest title was about 675K chars
  • shortening only those active titles made chat switching much faster
  • first_user_message was left intact

Upstream Codex bug filed: openai/codex#21154

Requested skill behavior

keep-codex-fast should detect this condition in report mode and suggest a safe title repair. It should not mutate titles automatically unless the user explicitly asks for an apply/repair action.

Suggested report-only checks:

  • count active titles above a large threshold, e.g. 100,000 chars
  • total oversized-title chars
  • max active title chars
  • count where title = first_user_message
  • print a suggestion such as shorten_titles_after_backup
  • preserve privacy in default output by avoiding raw thread IDs, titles, and paths unless --details is used

Suggested repair behavior, if later implemented:

  • backup state_5.sqlite first
  • only update threads.title
  • preserve threads.first_user_message
  • target specific oversized/duplicated-title candidates, not all threads
  • keep Codex-closed / SQLite busy-timeout safety consistent with the rest of the skill

Why this belongs here

This is exactly the kind of local-state bloat that makes Codex feel slow but is easy to diagnose safely. The skill already reports active session size, stale worktrees, logs, path normalization, config prune candidates, and process pressure; oversized active titles should be part of that same report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions