Subagent TUI corrupts live message text while raw rollout is correct

Resolved 💬 12 comments Opened Mar 18, 2026 by palvaleri Closed Mar 25, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.115.0

Which model were you using?

gpt-5.4

What platform is your computer?

Darwin arm64 (macOS)

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

Codex desktop / Codex TUI on macOS

What issue are you seeing?

In subagent sessions, the live TUI/subagent state surface sometimes corrupts the displayed text even though the raw rollout transcript is correct.

This is not just "markdown renders as plain text". The displayed line can:

  • drop leading characters inside words
  • remove punctuation or whitespace
  • break inline-code boundaries
  • partially mangle words in the middle of a sentence

The raw rollout for the same subagent session still contains the correct message, so this looks like a render/stream stitching bug in the subagent UI surface, not bad model output.

What steps can reproduce the bug?

I currently have two independent real reproductions from 0.115.0 subagent sessions in different worktrees/repos. In both cases, the corrupted text was shown live in the subagent UI surface, while the raw rollout for the same session was correct.

Repro A, subagent session 019cfe23-1c1a-7992-ba9c-86a7033c7c01:

TUI showed a corrupted line like:

• ейты проходят. Проверяю толькоVisual Acceptance`, чтобы корректно закры reviewer-флоу по этому plan и не застрять на неществующей UI-проверке.

But the raw rollout for the same session contains:

Гейты проходят. Проверяю только `Visual Acceptance`, чтобы корректно закрыть reviewer-флоу по этому plan и не застрять на несуществующей UI-проверке.

Repro B, subagent session 019cfe07-ce54-73b3-b5c5-a545aeccf4d5:

TUI showed a corrupted line like:

Evidence собожу reviewer artifact. Открою один-два свежих backend review-файла чтобы сохранить repo-local формат и правильно заироватьS` vs `

But the raw rollout for the same session contains:

Evidence собран; перехожу к reviewer artifact. Открою один-два свежих backend review-файла, чтобы сохранить repo-local формат и правильно зафиксировать `S2` vs `N/A` для visual review.

What is the expected behavior?

The subagent TUI/state surface should display the same text that is present in the raw rollout transcript, preserving characters, whitespace, punctuation, and inline-code boundaries.

Additional information

These two reproductions are useful because they are not the same exact workflow:

  • they come from different worktrees/repos
  • they affect live subagent commentary text, not just one static final handoff line
  • the corruption pattern is similar in both cases
  • the raw transcript remains intact in both cases

This seems related to, but not identical with:

  • #13220 — subagent state markdown rendering is wrong
  • #10901 — main TUI can cut off or oddly space output while the transcript remains correct

My current read is:

  • #13220 is about incorrect markdown rendering in the subagent state surface
  • this bug is about the subagent state surface corrupting the actual displayed text
  • #10901 may share the same underlying rendering/streaming cause, but this report is specifically about subagent live text corruption with the raw rollout remaining intact

View original on GitHub ↗

12 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #13686
  • #14768

Powered by Codex Action

palvaleri · 4 months ago

Third 0.115.0 reproduction from subagent session 019cfdea-d46c-7233-bcbd-0fa91851dd72.

This one is stronger than the previous two because the TUI appears to have visually fused two separate clean commentary messages into one garbled block.

Raw rollout contains these two distinct commentary messages:

Вношу две узкие правки в tooling docs: уточняю исключение для `Architect initial draft` и добавляю owner-facing инструкцию по `racex_plan_bundle`. После этого синхронизирую mirror `docs/plans/README.md` в sibling `racex`.
Mirror-патч не прошёл через `apply_patch`; tooling-файл отдельно дожму сейчас, а для sibling mirror, если понадобится, пойду через явное разрешение на один безопасный sync-патч.

But the live TUI showed a mangled block roughly like:

ношу две узкие правки в tooling: уточняю исключение Architect initialля owner-facing инструкцию по racex_plan_bundle. синхронизир mirror /.md ex.Точечно чиню
формулировку и пробую сразу же синхрон mirror-патч в ~/racex/plans/README.md. Если sandbox не даст писать sibling repo, запрошу отдельноеение на mirror.Mirror-
патч неёл через apply_patch; tooling-файл отдельно дожму сейчас, а для sibling mirror, если понадобится, пой через явное разрешение наный syncатч.

So this is not just a single-line character drop. In this repro the subagent UI surface appears to merge adjacent commentary items and then corrupt characters/whitespace/inline-code boundaries while rendering them.

palvaleri · 4 months ago

Additional reproduction from subagent session 019d014d-b995-7741-9eb9-edd0de5212a1 (codex-cli 0.115.0, gpt-5.4, originator=codex-tui, source.thread_spawn, worktree codex-session-router).

This one is useful because it happened right after an image-review workflow.

What happened:

  • the owner provided screenshots by absolute filesystem path (for example /Users/.../Снимок экрана ... .png)
  • view_image succeeded on those files, so local image-by-path inspection was working
  • the final subagent message stored in the raw rollout is clean and semantically correct
  • but the visible TUI/app subagent surface rendered that same message as corrupted text:
  • code fences / inline code boundaries were broken
  • lines were fused together
  • leading path characters were visually dropped
  • the visible text changed meaning (contains no valid profiles appeared as contains valid profiles)

Raw rollout message:

Да, это уже реальный blocker.

Что видно сейчас:
- проблема с путями исправлена;
- новая ошибка другая: роутер не находит ни одного валидного auth-профиля.

Лог menubar app теперь такой:
auth pool at `/Users/palvaleri/codex-session-router/var/auth` contains no valid profiles

И я проверил сам `var/auth`:
- там есть только `README.md`
- ни одного профиля/`auth.json` там нет

Поэтому `Start` сейчас не может пройти в принципе. Это уже не UI-мелочь, а реальный runtime blocker для шага `running state`.

So this is another case where:

  • raw rollout is correct
  • displayed subagent text is corrupted
  • this happens in a spawned subagent, not the main thread

Related observation (more tentative):

  • in the same workflow the user reported clipboard-image paste was not working, so screenshots were passed by path instead
  • the rollout for those user turns shows images=[] and local_images=[], while view_image on explicit PNG paths works
  • I cannot prove the clipboard bug from rollout alone, but this reproduction is at least compatible with a broken image-attach/input path plus the already-known subagent render corruption
YoloMark98 · 4 months ago

'
Would you like to make the following edits?

Thread: Fermat [working_high]

Reason: command failed; retry without sandbox?' so how i can fix this issue?

ignatremizov · 4 months ago

Additional data point from local Linux/native TUI usage:

  • Main thread rendering stays clean even when switching away and back.
  • The corruption shows up specifically when switching into spawned subagent threads and reading their reconstructed history/UI surface.
  • The raw child rollout/session logs remain correct; the visible subagent surface is what becomes garbled.
  • This makes it look less like bad model output and more like a subagent replay/render path bug.

Current hypothesis from reading the TUI source:

  • Inactive subagent threads are buffered in ThreadEventStore and rebuilt on switch via replay_thread_snapshot(...).
  • During replay, AgentMessageDelta still flows through the normal streaming path (handle_codex_event_replay -> on_agent_message_delta -> streaming controller / commit tick), instead of rendering only finalized transcript cells.
  • That would explain why the main thread is usually fine while switched-to subagent threads show fused / dropped / punctuation-damaged text even though the raw rollout is correct: the subagent view is being visually restreamed during reconstruction.

So the likely fix area seems to be thread-snapshot replay for subagents:

  • either materialize finalized assistant transcript content directly during replay,
  • or suppress the live streaming/commit-animation path while reconstructing a switched thread.

I did not see evidence that this requires fork_context=true; the same visible corruption reproduced for me after explicitly steering supervisors to spawn workers with fork_context=false.

fcoury contributor · 3 months ago

@palvaleri @ignatremizov @YoloMark98 this has been fixed on 0.116.0. Can you please retest and confirm you can no longer replicate this issue?

ignatremizov · 3 months ago

@fcoury you refer to:

  • 78e8ee459: fix(tui): restore remote resume and fork history (#14930)
  • 57f865c06: Fix tui_app_server: ignore duplicate legacy stream events (#14892)
  • b0236501e: Remove legacy app-server notification handling from tui_app_server (#15390)

So far, I have not observed the issue again... I think I made my comment while on 116, although I might have been running the thread still on 115 before I restarted. I'm also not sure how the codex-rs/tui or codex-rs/tui_app_server paths are chosen right now, maybe it is still present on one or the other still. I'll be sure to report if I hit it again.

ignatremizov · 3 months ago

https://github.com/ignatremizov/codex/commit/2523697dcb8287cc86c743ae7e17ffdebd700fa9 might still be a useful hardening, codex gpt 5.4 was working on hardening the agent-switch rollout TUI and added this

palvaleri · 3 months ago

Retested on codex-cli 0.116.0 on macOS after updating locally.

I can confirm I am no longer seeing the subagent text-corruption / garbled-live-render issue that this ticket was about. I am switching into subagents and the previous “кашеобразный” broken rendering is gone for me.

So from my side this now looks fixed in 0.116.0. Thanks — this was genuinely painful to work with before, and the difference is immediately noticeable.

palvaleri · 3 months ago

Confirmed fixed on local retest with codex-cli 0.116.0. Thank you.

DZ20000 · 1 day ago

Reproduced on 2026-07-19 in the Codex desktop app on Windows 11 during a long conversation with subagents and repeated tool calls.

Observed two related presentation failures in the same session:

  1. Internal orchestration output that would normally be folded into the tool trace was rendered directly in the conversation, including a failed tool invocation and a very large tool-metadata dump.
  2. An assistant progress message contained an unrelated non-Chinese fragment in the middle of otherwise valid Chinese text. This happened again in the same session and was visible to the user, so it was not just a terminal encoding issue in a subprocess.

The conversation had recently used subagents and had accumulated a long context. The bad text appeared in the Codex UI. No repository file or shell output contained that fragment.

This looks close to #15001's presentation-layer symptoms, but the current occurrence is in Codex desktop rather than the TUI and is not limited to switching away from and back to a subagent. It may be useful to check whether the desktop app and TUI share the same event reconstruction / streaming path.

Expected: assistant text and tool trace remain separate; failed orchestration calls stay in the tool trace and assistant text is rendered byte-for-byte as generated.

Privacy note: I have omitted user content, local paths, credentials, and the full tool metadata dump. I can provide a sanitized screenshot or diagnostics if a maintainer identifies the preferred collection path.

DZ20000 · 1 day ago

Environment detail from the affected run: Windows 11; Codex desktop package version 26.715.4045 (identified from the installed package path). The built-in executable could not be queried directly because WindowsApps denied direct execution outside the packaged app context.