Skip to content

Archiving a codex thread leaves the session in Codex Desktop's list forever #1984

Open

Description

@kravtsovd

Summary

Archiving a codex-backed thread in bb reaches Codex on disk but not in its UI. The session stays in the Codex Desktop sidebar permanently — a restart does not clear it.

Environment

  • bb 0.38.0 / 0.39.0 (macOS), provider codex
  • Codex.app 26.814.41407 with embedded codex-cli 0.148.0-alpha.15

Steps to reproduce

  1. Open Codex Desktop and note a session in the sidebar.
  2. In bb, archive the thread backed by that session (bb thread archive <id>, or the sidebar action).
  3. Watch the Codex Desktop sidebar.

Expected: the session disappears from the list, as it does when archived from inside Codex.

Actual: the row stays. It survives app restarts and never goes away.

What is actually happening

The archive itself works — bb does its part correctly:

  • the rollout moves to ~/.codex/archived_sessions/
  • threads.archived flips to 1 in ~/.codex/state_5.sqlite
  • codex resume no longer offers the session

But Codex Desktop does not read either of those for its list. It keeps its own catalogue in ~/.codex/sqlite/codex-dev.db → local_thread_catalog, which has no archived column. A row leaves that catalogue only via:

  • handleNotification on a thread/archived / thread/deleted broadcast from its own app-server → applyAuthoritativeRemoval(threadId), or
  • a full reconciliation scan — but isFullReconciliationDue() returns true only when !isComplete || lastFullReconciliationAt == null. Once last_full_reconciled_at is set, the full scan never runs again, and the incremental scan calls listThreads({archived: false}), so it cannot learn about a thread that disappeared.

bb spawns its own codex app-server child process and calls thread/archive there. Codex Desktop's app-server (a separate child of the Electron process) never hears about it, so the notification that would remove the row is never emitted.

Evidence on our machine: of the codex threads archived from inside the app, 63 are correctly absent from the catalogue. Of those archived from outside (via bb), 8 out of 8 are still listed.

Confirmed fix path

Codex has a cross-client bus at ~/.codex/ipc/ipc.sock, owned by the Electron process. Its own clients broadcast thread-archived there on archive. Sending that same broadcast after bb's archive removes the row from the sidebar within ~1s, verified visually; thread-unarchived restores it. local_thread_catalog is left untouched — the app stops showing the row by itself, so nothing needs deleting from its database.

So the missing piece looks like: whoever archives a session from outside the app should announce it on that bus. Today bb archives and stays silent.

Important caveat: we found the message shape by reading Codex.app/Contents/Resources/app.asar, not from documentation. Please treat the exact payload as an observation to verify against Codex's own source rather than as a specification.

Secondary, upstream-Codex

Because isFullReconciliationDue() never fires again after the first successful build, a missed broadcast is unrecoverable — no restart, no rescan, ever. That is arguably worth fixing on the Codex side independently, but it is not blocking if bb emits the broadcast.

Workaround we are using

Our sidebar plugin sends the broadcast itself after archiving, strictly best-effort: if the socket is missing or the protocol changes, it silently falls back to today's behaviour and never fails or reverts the archive. We would happily drop that code once bb emits it.

Activity

  1. added theissue type on Aug 20, 2026
  2. added
    providers
    provider-codex
    on Aug 20, 2026
  3. SawyerHood commented on Aug 20, 2026

    @SawyerHood
    Collaborator

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1984.html

    • Verdict: PARTIALLY REPRODUCED · root-cause confidence: high
    • Root cause (short): bb archives via thread/archive on its own codex app-server child; Codex Desktop prunes its sidebar catalogue (local_thread_catalog) only from its own app-server's thread/archived notification or a one-time full reconciliation (isFullReconciliationDue = !isComplete || lastFullReconciliationAt==null; incremental scans list archived:false), so an archive from any other process is never seen.
    • Proposed fix: Real fix belongs upstream in Codex Desktop (reconcile catalogue against state DB / fan out thread/archived across processes). bb-side best-effort mitigation: in plugins/provider-codex/src/bridge/bridge.ts handleThreadMaintenance, after a successful thread/archive|unarchive, connect to /ipc/ipc.sock (Windows \.\pipe\codex-ipc) and write one u32LE-length-prefixed JSON frame {type:"broadcast", method:"thread-archived"|"thread-unarchived", sourceClientId:"bb", params:{hostId:"local", conversationId:, cwd}, version:2|1}; fire-and-forget, never fail the archive. Caveats:…
    • Caveats: Codex Desktop is not installed/runnable on this Linux box, so the sidebar symptom itself was not observed; mechanism reproduced with a second codex app-server standing in for Desktop (0 thread/archived notifications across bb's archive; same-process control does receive one) and all Desktop-internal claims verified by reading app.asar from the official Linux build 26.818.21641 (reporter used macOS…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at the base commit, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  4. added
    partial-repro
    on Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    partial-reproprovider-codexproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions