Skip to content

Esc Esc Enter no longer works to fork from a previous prompt in the session history #38686

Description

@jyn514

What version of Codex CLI is running?

codex-cli 0.147.0

What subscription do you have?

Pro

Which model were you using?

any model; the uploaded thread is for gpt-5.6-sol

What platform is your computer?

Darwin 25.5.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

n/a, but i'm using heavily customized tmux with iTerm2

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1786758099s since unix epoch",
  "overallStatus": "fail",
  "codexVersion": "0.147.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/Users/jyn/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/Users/jyn/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/Users/jyn/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/Users/jyn/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/Users/jyn/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth file": "/Users/jyn/.codex/auth.json",
        "auth storage mode": "File",
        "stored API key": "false",
        "stored ChatGPT tokens": "true",
        "stored agent identity": "false",
        "stored auth mode": "chatgpt"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "/Users/jyn/.codex",
        "config.toml": "/Users/jyn/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/Users/jyn/src/dotfiles",
        "enabled feature flags": "shell_tool, view_image, unified_exec, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, in_app_updates, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, item_ids, skill_mcp_dependency_install, skill_search, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "39",
        "log dir": "/Users/jyn/.codex/log",
        "mcp servers": "2",
        "model": "gpt-5.6-sol",
        "model provider": "openai",
        "sqlite home": "/Users/jyn/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.50.1 (Apple Git-155)",
      "details": {
        ".git entry": "directory",
        "PATH git #1": "/usr/bin/git",
        "PATH git #2": "/opt/homebrew/bin/git",
        "PATH git entries": "2",
        "git branch": "detached HEAD",
        "git build options": "git version 2.50.1 (Apple Git-155); cpu: arm64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh; feature: fsmonitor--daemon; libcurl: 8.7.1; zlib: 1.2.12; SHA-1: SHA1_DC; SHA-256: SHA256_BLK",
        "git exec path": "/Library/Developer/CommandLineTools/usr/libexec/git-core",
        "git version": "git version 2.50.1 (Apple Git-155)",
        "repo detected": "true",
        "repo root": "/Users/jyn/src/dotfiles",
        "selected git": "/usr/bin/git"
      },
      "remediation": null,
      "durationMs": 324
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/Users/jyn/src/dotfiles/bin/codex",
        "PATH codex #2": "/opt/homebrew/bin/codex",
        "PATH codex entries": "2",
        "current executable": "/opt/homebrew/bin/codex",
        "install context": "brew (package /opt/homebrew/Caskroom/codex/0.147.0, bin /opt/homebrew/Caskroom/codex/0.147.0/bin, resources /opt/homebrew/Caskroom/codex/0.147.0/codex-resources, path /opt/homebrew/Caskroom/codex/0.147.0/codex-path)",
        "managed by bun": "false",
        "managed by npm": "false",
        "managed by pnpm": "false",
        "managed package root": "not set"
      },
      "remediation": null,
      "durationMs": 18
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "MCP configuration is locally consistent",
      "details": {
        "configured servers": "2",
        "disabled servers": "1",
        "stdio servers": "1",
        "streamable_http servers": "1"
      },
      "remediation": null,
      "durationMs": 579
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "proxy env vars": "none"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 403)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 421
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 0 IPv6, first IPv4",
        "auth mode": "chatgpt",
        "connect timeout": "15000 ms",
        "endpoint": "wss://chatgpt.com/backend-api/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "models etag present": "true",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 1116
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running brew on macos-aarch64",
      "details": {
        "commit": "unknown",
        "current executable": "/opt/homebrew/bin/codex",
        "install method": "brew (package /opt/homebrew/Caskroom/codex/0.147.0, bin /opt/homebrew/Caskroom/codex/0.147.0/bin, resources /opt/homebrew/Caskroom/codex/0.147.0/codex-resources, path /opt/homebrew/Caskroom/codex/0.147.0/codex-path)",
        "platform": "macos-aarch64",
        "version": "0.147.0"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/opt/homebrew/Caskroom/codex/0.147.0/codex-path/rg",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "none",
        "execve wrapper helper": "/Users/jyn/.codex/tmp/arg0/codex-arg0lTngKu/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "network sandbox": "restricted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "fail",
      "summary": "state database integrity check failed",
      "details": {
        "CODEX_HOME": "/Users/jyn/.codex (dir)",
        "active rollout files": "1524 files, 1505487096 total bytes, 987852 average bytes",
        "archived rollout files": "2261 files, 2143165232 total bytes, 947883 average bytes",
        "goals DB": "/Users/jyn/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/Users/jyn/.codex/logs_2.sqlite (file)",
        "log DB integrity": "*** in database main ***\nFreelist: Failed to read ptrmap key=51942\nFreelist: Bad ptr map entry key=142447 expected=(2,0) got=(5,735914)\nFreelist: Failed to read ptrmap key=183933\nFreelist: Failed to read ptrmap key=136219\nFreelist: Failed to read ptrmap key=184049\nFreelist: Failed to read ptrmap key=312999\nFreelist: Bad ptr map entry key=183836 expected=(2,0) got=(3,263688)\nFreelist: Failed to read ptrmap key=182908\nFreelist: Failed to read ptrmap key=182928\nFreelist: Failed to read ptrmap key=183686\nFreelist: Failed to read ptrmap key=183472\nFreelist: Failed to read ptrmap key=183351\nFreelist: Failed to read ptrmap key=183198\nFreelist: Failed to read ptrmap key=182930\nFreelist: Failed to read ptrmap key=183409\nFreelist: Bad ptr map entry key=184357 expected=(2,0) got=(2,3625722323)\nFreelist: Failed to read ptrmap key=184039\nFreelist: Failed to read ptrmap key=183857\nFreelist: Failed to read ptrmap key=312723\nFreelist: Failed to read ptrmap key=184103\nFreelist: Failed to read ptrmap key=183223\nFreelist: Failed to read ptrmap key=313193\nFreelist: Bad ptr map entry key=183986 expected=(2,0) got=(4,471979138)\nFreelist: Bad ptr map entry key=184341 expected=(2,0) got=(3,672932307)\nFreelist: Failed to read ptrmap key=183596\nFreelist: Failed to read ptrmap key=183622\nFreelist: Failed to read ptrmap key=183798\nFreelist: Bad ptr map entry key=183789 expected=(2,0) got=(5,327685)\nFreelist: Failed to read ptrmap key=183770\nFreelist: Failed to read ptrmap key=312897\nFreelist: Failed to read ptrmap key=184091\nFreelist: Bad ptr map entry key=183793 expected=(2,0) got=(5,327685)\nFreelist: Failed to read ptrmap key=182942\nFreelist: Failed to read ptrmap key=183303\nFreelist: Bad ptr map entry key=183872 expected=(2,0) got=(3,269345)\nFreelist: Failed to read ptrmap key=183598\nFreelist: Failed to read ptrmap key=182890\nFreelist: Failed to read ptrmap key=182925\nFreelist: Failed to read ptrmap key=312935\nFreelist: Failed to read ptrmap key=183187\nFreelist: Failed to read ptrmap key=31789\nFreelist: Failed to read ptrmap key=183011\nFreelist: Failed to read ptrmap key=183868\nFreelist: Failed to read ptrmap key=183195\nFreelist: Failed to read ptrmap key=184391\nFreelist: Bad ptr map entry key=183159 expected=(2,0) got=(4,1885955130)\nFreelist: Failed to read ptrmap key=184352\nFreelist: Failed to read ptrmap key=184265\nFreelist: Bad ptr map entry key=183848 expected=(2,0) got=(3,269345)\nFreelist: Failed to read ptrmap key=183044\nFreelist: Failed to read ptrmap key=183099\nFreelist: Bad ptr map entry key=184205 expected=(2,0) got=(5,3491504595)\nFreelist: Bad ptr map entry key=184114 expected=(2,0) got=(4,471979054)\nFreelist: Failed to read ptrmap key=183000\nFreelist: Failed to read ptrmap key=312782\nFreelist: Failed to read ptrmap key=312764\nFreelist: Bad ptr map entry key=183737 expected=(2,0) got=(5,1208303621)\nFreelist: Failed to read ptrmap key=313083\nFreelist: Failed to read ptrmap key=183121\nFreelist: Failed to read ptrmap key=184484\nFreelist: Failed to read ptrmap key=183245\nFreelist: Bad ptr map entry key=169744 expected=(2,0) got=(2,2550137628)\nFreelist: Bad ptr map entry key=184333 expected=(2,0) got=(3,1344020947)\nFreelist: Failed to read ptrmap key=184023\nFreelist: Failed to read ptrmap key=172729\nFreelist: Failed to read ptrmap key=184045\nFreelist: Failed to read ptrmap key=183046\nFreelist: Failed to read ptrmap key=183356\nFreelist: Failed to read ptrmap key=183891\nFreelist: Failed to read ptrmap key=183839\nFreelist: Bad ptr map entry key=183076 expected=(2,0) got=(4,74475876)\nFreelist: Failed to read ptrmap key=312467\nFreelist: Failed to read ptrmap key=183429\nFreelist: Failed to read ptrmap key=183349\nFreelist: Failed to read ptrmap key=183162\nFreelist: Failed to read ptrmap key=183973\nFreelist: Failed to read ptrmap key=183466\nFreelist: Failed to read ptrmap key=183411\nFreelist: Failed to read ptrmap key=312429\nFreelist: Failed to read ptrmap key=183341\nFreelist: Failed to read ptrmap key=183540\nFreelist: Failed to read ptrmap key=184497\nFreelist: Failed to read ptrmap key=182906\nFreelist: Failed to read ptrmap key=183373\nFreelist: Failed to read ptrmap key=183273\nFreelist: Failed to read ptrmap key=182929\nFreelist: Failed to read ptrmap key=184371\nFreelist: Failed to read ptrmap key=150705\nFreelist: Failed to read ptrmap key=134333\nFreelist: Failed to read ptrmap key=134038\nFreelist: Failed to read ptrmap key=75590\nFreelist: Failed to read ptrmap key=150818\nFreelist: Failed to read ptrmap key=138617\nFreelist: Failed to read ptrmap key=155852\nFreelist: Failed to read ptrmap key=52005\nFreelist: Failed to read ptrmap key=51760\nFreelist: Failed to read ptrmap key=51883\nFreelist: Failed to read ptrmap key=51929\nFreelist: Failed to read ptrmap key=52025\nFreelist: Failed to read ptrmap key=52026",
        "log dir": "/Users/jyn/.codex/log (missing)",
        "memories DB": "/Users/jyn/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "queue DB": "/Users/jyn/.codex/queue_1.sqlite (file)",
        "queue DB integrity": "ok",
        "sqlite home": "/Users/jyn/.codex (dir)",
        "state DB": "/Users/jyn/.codex/state_5.sqlite (file)",
        "state DB integrity": "row 366 missing from index idx_threads_archived_cwd_recency_at_ms; row 366 missing from index idx_threads_recency_at_ms; row 366 missing from index idx_threads_archived_cwd_updated_at_ms; row 366 missing from index idx_threads_updated_at_ms; row 366 missing from index idx_threads_updated_at; row 369 missing from index idx_threads_visible_recency_at_ms; row 369 missing from index idx_threads_visible_updated_at_ms",
        "thread history DB": "/Users/jyn/.codex/thread_history_1.sqlite (file)",
        "thread history DB integrity": "ok"
      },
      "remediation": "Move the damaged SQLite database aside, then restart the interactive CLI or app server so it can rebuild that runtime database from saved data. Other entry points may not rebuild automatically.",
      "durationMs": 532
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "warning",
      "summary": "rollout files and state DB thread inventory differ",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "1524",
        "rollout DB active rows": "3233",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "2261",
        "rollout DB archived rows": "0",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread ids": "0",
        "rollout DB malformed file names": "0",
        "rollout DB missing active rows": "534",
        "rollout DB missing active sample": [
          "/Users/jyn/.codex/sessions/2026/08/13/rollout-2026-08-13T15-28-41-019ffbbd-66a8-7ed0-9090-a98c965ac540.jsonl",
          "/Users/jyn/.codex/sessions/2026/08/12/rollout-2026-08-12T16-07-57-019ff6ba-fe84-7b41-a81b-f137ae56fcca.jsonl",
          "/Users/jyn/.codex/sessions/2026/08/12/rollout-2026-08-12T11-26-06-019ff54b-14c7-7122-8ef7-b9c401502aa6.jsonl",
          "/Users/jyn/.codex/sessions/2026/08/12/rollout-2026-08-12T16-48-07-019ff6df-c4ef-7401-abef-2659367a081f.jsonl",
          "/Users/jyn/.codex/sessions/2026/08/12/rollout-2026-08-12T16-12-56-019ff6bf-8ed1-7970-8b8b-1be29728648f.jsonl"
        ],
        "rollout DB missing archived rows": "2261",
        "rollout DB missing archived sample": [
          "/Users/jyn/.codex/archived_sessions/rollout-2026-06-22T17-40-48-019eeffd-ceda-71c3-8664-99fd30bfb6bf.jsonl",
          "/Users/jyn/.codex/archived_sessions/rollout-2026-06-21T15-06-02-019eea49-bf24-7393-b5b8-d2989b10abf4.jsonl",
          "/Users/jyn/.codex/archived_sessions/rollout-2026-06-24T20-48-43-019efaf6-8eeb-7191-98e7-eda0b04d32d0.jsonl",
          "/Users/jyn/.codex/archived_sessions/rollout-2026-07-05T16-57-34-019f32c8-e576-7482-a546-71e88a98130f.jsonl",
          "/Users/jyn/.codex/archived_sessions/rollout-2026-06-28T15-10-01-019f0e59-e899-7421-827e-90b275149f49.jsonl"
        ],
        "rollout DB model providers": "openai=3233",
        "rollout DB rows": "3233",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "subagent:thread_spawn=1671, cli=1406, exec=149, subagent:review=7",
        "rollout DB stale row sample": [
          "/Users/jyn/.codex/sessions/2026/05/28/rollout-2026-05-28T22-40-51-019e7051-8485-70c2-b594-ffcc10576608.jsonl",
          "/Users/jyn/.codex/sessions/2026/05/28/rollout-2026-05-28T23-30-25-019e707e-e74b-7d02-b916-b65d00306855.jsonl",
          "/Users/jyn/.codex/sessions/2026/05/29/rollout-2026-05-29T03-16-59-019e714e-52fb-7ac1-af08-d4b05444ed89.jsonl",
          "/Users/jyn/.codex/sessions/2026/05/29/rollout-2026-05-29T03-21-54-019e7152-d625-7802-9809-c51d743d2eac.jsonl",
          "/Users/jyn/.codex/sessions/2026/05/29/rollout-2026-05-29T03-43-31-019e7166-9e7c-70b3-8330-550effaabeda.jsonl"
        ],
        "rollout DB stale rows": "2243"
      },
      "issues": [
        {
          "severity": "warning",
          "cause": "rollout files are missing from the state DB",
          "measured": "534 active, 2261 archived",
          "expected": "every rollout file has a matching threads row",
          "remedy": null,
          "fields": []
        },
        {
          "severity": "warning",
          "cause": "state DB rows point at missing or unusable rollout files",
          "measured": "2243 stale rows",
          "expected": "every state DB rollout path is a file on disk",
          "remedy": null,
          "fields": []
        }
      ],
      "remediation": null,
      "durationMs": 3325
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language nl-NL",
      "details": {
        "EDITOR": "set",
        "LANG": "nl_NL.UTF-8",
        "LESS": "set",
        "PAGER": "set",
        "VISUAL": "set",
        "os": "Mac OS 26.5.2 [64-bit]",
        "os language": "nl-NL",
        "os type": "Mac OS",
        "os version": "26.5.2"
      },
      "remediation": null,
      "durationMs": 9
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "warning",
      "summary": "height 22 rows - content may scroll off (recommended >=24)",
      "details": {
        "COLORFGBG": "15;0",
        "COLORTERM": "truecolor",
        "TERM": "xterm-256color",
        "TERMINFO_DIRS entry": [
          "/Applications/iTerm.app/Contents/Resources/terminfo (dir)",
          "/usr/share/terminfo (dir)"
        ],
        "TERM_PROGRAM": "iTerm2",
        "color output": "disabled (stdout is not a terminal)",
        "effective locale": "nl_NL.UTF-8",
        "multiplexer": "tmux next-3.8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "false",
        "terminal": "iTerm2",
        "terminal size": "91x22",
        "terminal version": "3.5.14",
        "tmux allow-passthrough": "on",
        "tmux client termname": "xterm-256color",
        "tmux client termtype": "iTerm2 3.5.14",
        "tmux extended-keys": "on",
        "tmux focus-events": "on",
        "tmux set-clipboard": "on",
        "tmux xterm-keys": "on"
      },
      "issues": [
        {
          "severity": "warning",
          "cause": "height 22 rows - content may scroll off (recommended >=24)",
          "measured": "91 x 22",
          "expected": ">= 24 rows",
          "remedy": "resize the window to at least 24 rows",
          "fields": [
            "terminal size"
          ]
        }
      ],
      "remediation": null,
      "durationMs": 128
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title configured",
      "details": {
        "terminal title activity": "false",
        "terminal title items": "run-state, context-used, model",
        "terminal title source": "configured"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.147.0",
        "check for update on startup": "true",
        "dismissed version": "0.145.0",
        "last checked at": "2026-08-14T12:21:02.523489Z",
        "latest version": "0.147.0",
        "latest version status": "current version is not older",
        "update action": "brew upgrade --cask codex",
        "version cache": "/Users/jyn/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 100
    }
  }
}

What issue are you seeing?

Esc Esc should edit the previous prompt. Instead, it prints "■ Failed to branch before the selected prompt: the selected prompt was not found in the persisted thread" in red text. This happens consistently across different sessions and models.

What steps can reproduce the bug?

Uploaded thread: 01a00307-0c5d-71a3-9d27-2430185ed3b8

What is the expected behavior?

No response

Additional information

Sol thinks that #36950 introduced the regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions