openai / openai/codex

[Codex desktop] Treat custom sidebar sections as worktree retention signals

Open
#42,168 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app enhancement session
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What variant of Codex are you using?

ChatGPT/Codex desktop app for macOS 26.831.20005 (build 7524), with bundled codex-cli 0.152.0.

What feature would you like to see?

Please treat membership in any custom sidebar section as a retention signal for a Codex-managed worktree, similar to pinning. Alternatively, add a per-section Keep associated worktrees setting that defaults to on.

The desktop app now supports custom sidebar sections, but native worktree cleanup currently documents protection only for pinned chats, in-progress chats, and permanent worktrees. A task can therefore remain deliberately organized in a custom section while its associated managed worktree is automatically removed under the configured cleanup limit.

Reproduction:

  1. Create a Codex task in a managed worktree.
  2. Put the task in a custom sidebar section such as To Do, Automations, or Backlog.
  3. Unpin the task because the custom section is now its intended persistent location.
  4. Create enough newer managed worktrees to exceed the automatic-cleanup limit.
  5. The sectioned task remains visible, but its worktree can be removed and must later be restored from the task.

Expected behavior:

  • A task in Pinned or any present or future custom sidebar section keeps its associated managed worktree.
  • Removing a task from all custom sections and unpinning it makes the worktree eligible for the existing native cleanup policy.
  • Archiving and permanent-worktree behavior remain unchanged.
  • The retention decision survives app restarts and applies consistently to scheduled/automation tasks placed in a custom section.

Why this matters:

Custom sections are an explicit user signal that a task is being retained for future work. Losing the attached worktree is surprising, creates restore/recovery friction, and makes section-based organization less reliable than pinning. The current workaround is to disable native cleanup and maintain a separate section-aware cleanup process, which duplicates logic that the app already owns.

Official cleanup documentation: https://learn.chatgpt.com/docs/environments/git-worktrees

Related but not duplicate: #28692 introduced/requested custom sidebar organization; this request is specifically about integrating custom-section membership with native worktree retention.

Additional information

The restore snapshot reduces permanent-loss risk, but users should not need to restore worktrees for tasks they intentionally kept in a custom section. A default-on per-section retention toggle would preserve current cleanup flexibility without requiring every section to be permanent.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing native managed-worktree cleanup and how the desktop app records pinned, in-progress, permanent, and custom-section membership. Verify the existing cleanup behavior and the persistence path across restarts, then define completion against the stated retention and eligibility rules for regular and automation tasks.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.