Subagent TUI corrupts live message text while raw rollout is correct
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:
#13220is about incorrect markdown rendering in the subagent state surface- this bug is about the subagent state surface corrupting the actual displayed text
#10901may share the same underlying rendering/streaming cause, but this report is specifically about subagent live text corruption with the raw rollout remaining intact
12 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Third
0.115.0reproduction from subagent session019cfdea-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:
But the live TUI showed a mangled block roughly like:
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.
Additional reproduction from subagent session
019d014d-b995-7741-9eb9-edd0de5212a1(codex-cli 0.115.0,gpt-5.4,originator=codex-tui,source.thread_spawn, worktreecodex-session-router).This one is useful because it happened right after an image-review workflow.
What happened:
/Users/.../Снимок экрана ... .png)view_imagesucceeded on those files, so local image-by-path inspection was workingcontains no valid profilesappeared ascontains valid profiles)Raw rollout message:
So this is another case where:
Related observation (more tentative):
images=[]andlocal_images=[], whileview_imageon explicit PNG paths works'
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?
Additional data point from local Linux/native TUI usage:
Current hypothesis from reading the TUI source:
ThreadEventStoreand rebuilt on switch viareplay_thread_snapshot(...).AgentMessageDeltastill 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.So the likely fix area seems to be thread-snapshot replay for subagents:
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 withfork_context=false.@palvaleri @ignatremizov @YoloMark98 this has been fixed on 0.116.0. Can you please retest and confirm you can no longer replicate this issue?
@fcoury you refer to:
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/tuiorcodex-rs/tui_app_serverpaths 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.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
Retested on
codex-cli 0.116.0on 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.Confirmed fixed on local retest with
codex-cli 0.116.0. Thank you.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:
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.
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.