Markdown Format Inconsistency
Open 💬 2 comments Opened May 19, 2026 by chaitanyamedidar
What version of the Codex App are you using (From “About Codex” dialog)?
26.513.40821
What subscription do you have?
Go
What platform is your computer?
Windows 11
What issue are you seeing?
<img width="982" height="207" alt="Image" src="https://github.com/user-attachments/assets/eb605153-a338-4811-8185-3307acd32e09" />
When the model is prompted to provide the content in markdown format, it ends the markdown content box abruptly whenever the markdown contains fenced code block (```), reverting back to normal text.
What steps can reproduce the bug?
- Open Codex
- Prompt the agent to provide any content that includes any fenced code blocks
What is the expected behavior?
- The agent should be able to close the fenced code block
- The agent should continue to provide the content in markdown, where the user could copy directly
Additional information
_No response_
2 Comments
I can reproduce what looks like the same failure mode in a narrower workflow: ask Codex to draft a GitHub issue or PR body, but not submit it.
I also checked the raw output through Codex's Alt+R raw transcript view. In that view, the assistant message starts with an outer three-backtick
markdownfence and later emits a final closing three-backtick fence, so this does not look like the terminal or transcript storage dropping the closing fence.The problem appears when the drafted Markdown document itself contains a fenced code block using the same three-backtick delimiter:
````text
Then continue with
inline codeand more Markdown.Local workaround is to add line in your AGENTS.md to say something like:
Always use four backticks to surround markdown that will contain other code fencesor something similar (YMMV)
Ideally this might be something that's worth pushing back into the training, it impacts both codex and chatgpt pretty often. @celia-oai. It may be worth adding to the system prompts too in the meantime.