Codex Desktop: MCP form elicitation messages collapse newline characters in approval UI
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- tailwindcss, typescript
Research direction
Inspect the form-mode MCP elicitation approval renderer and the container displaying params.message; reproduce the issue with the LF and CRLF examples from the report. Done means line breaks remain visible as escaped plain text, long unbroken content wraps in the dialog, and single-line messages remain unchanged.
Written by the indexing model from the issue text.
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.721.4979.0
What subscription do you have?
ChatGPT subscription. The exact tier is not available in this diagnostic context; the issue is in the client-side rendering of an MCP message.
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What issue are you seeing?
Codex Desktop collapses newline characters in the plain-text message of an MCP form elicitation into spaces. This makes a structured approval prompt render as one dense paragraph, even though the MCP server deliberately separates the asset, risk, reasons, command/SQL, and authorization scope onto different lines.
For example, an MCP server sends a message equivalent to:
Protected operation requires approval
Asset: staging database
Risk: medium
Reason:
- The query has a broad filter.
SQL:
SELECT id, created_at
FROM logs
ORDER BY created_at DESC
LIMIT 1;
The approval UI currently renders it approximately as:
Protected operation requires approval Asset: staging database Risk: medium Reason: - The query has a broad filter. SQL: SELECT id, created_at FROM logs ORDER BY created_at DESC LIMIT 1;
Both LF (\n) and CRLF (\r\n) are collapsed. Raw HTML such as <br> is correctly treated as text and therefore cannot be used as a safe workaround. The issue is specifically about preserving line-break characters in the existing plain-text renderer, not enabling Markdown or HTML.
This is more than a cosmetic problem for approval dialogs: visually separating the target asset, risk assessment, exact operation, and authorization scope makes it substantially easier for users to review sensitive MCP actions before approving them.
What steps can reproduce the bug?
- Register an MCP server that supports
elicitation/create. - Have a tool send a form-mode elicitation whose
messagecontains\n, for example:
{
"jsonrpc": "2.0",
"id": "approval-1",
"method": "elicitation/create",
"params": {
"mode": "form",
"message": "Protected operation requires approval\n\nAsset: staging database\nRisk: medium\n\nSQL:\nSELECT id FROM logs LIMIT 1",
"requestedSchema": {
"type": "object",
"properties": {
"approve": {
"type": "boolean",
"title": "Approve this operation"
}
},
"required": ["approve"]
}
}
}
- Trigger the tool in Codex Desktop.
- Observe that the approval dialog displays the entire
messageas one paragraph instead of preserving its line breaks.
What is the expected behavior?
The form elicitation approval UI should preserve newline characters in params.message while continuing to render the value as escaped plain text.
The example above should display as separate visual blocks:
Protected operation requires approval
Asset: staging database
Risk: medium
SQL:
SELECT id FROM logs LIMIT 1
Long SQL, commands, hashes, and URLs should still wrap within the dialog instead of overflowing horizontally.
Additional information
A minimal rendering change would be to use white-space: pre-wrap on the message container, together with a long-token wrapping rule. With Tailwind utilities, the intended behavior is equivalent to:
<div className="text-sm font-medium whitespace-pre-wrap break-words">
{request.message}
</div>
If preserving repeated spaces is undesirable, whitespace-pre-line would also preserve newline characters:
<div className="text-sm font-medium whitespace-pre-line break-words">
{request.message}
</div>
Suggested acceptance criteria:
- LF and CRLF in an MCP form elicitation
messageproduce visible line breaks. - The message remains escaped plain text; Markdown and HTML are not interpreted.
- Long unbroken content still wraps inside the approval dialog.
- Existing single-line messages render unchanged.
I searched existing issues for MCP elicitation, approval rendering, newlines, line breaks, white-space, and pre-wrap. Related issues cover form elicitation acceptance/schema behavior or unrelated Markdown/input rendering, but I did not find one for newline preservation in the MCP form elicitation approval message.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
CLI enhancement model-behavior
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100