Skip to content

Bug: Markdown local file links render percent-encoded non-ASCII paths in transcript output #15499

Done

Description

@potato-dumplings

What version of the Codex App are you using (From “About Codex” dialog)?

26.318.11754 (1100)

What subscription do you have?

free

What platform is your computer?

Darwin 23.6.0 arm64 arm

What issue are you seeing?

In Codex Desktop transcript output, local markdown file links can display percent-encoded path text (for example %E6... / %C3%9F) instead of decoded UTF-8 characters.

I confirmed this is a rendering-path inconsistency:

  • Patch/status (“thinking/status layer”) shows decoded path text.
  • Markdown output layer may show encoded path text.

Example:

  • Actual (output layer): /Users/.../docs/random_%C3%9F.md:1
  • Expected: /Users/.../docs/random_ß.md:1

What steps can reproduce the bug?

  1. Ask Codex to output a markdown local link with an encoded UTF-8 path:
    [placeholder](/Users/example/code/codex/docs/random_%C3%9F.md:1)
  2. Observe the rendered transcript output layer.
  3. In affected builds, the displayed local path may remain percent-encoded.

Control case (invalid sequence should remain unchanged):
[bad](/Users/example/code/codex/docs/%E6%ZZ.md)

What is the expected behavior?

Local markdown file link destinations should be normalized for display:

  • Valid %XX UTF-8 sequences are decoded before rendering.
  • Invalid percent sequences remain unchanged.
  • Output rendering should be consistent with patch/status rendering.

Additional information

I traced, fixed, and validated this in the open-source codebase.

Confirmed cause:

  • Non-file:// local link targets were normalized without percent-decoding first in markdown render path.
  • file:// handling had decode coverage in URL path handling, but plain absolute local-path branch did not.

Fix applied in both implementations:

  • codex-rs/tui/src/markdown_render.rs
  • codex-rs/tui_app_server/src/markdown_render.rs

Change summary:

  • Decode %XX path text before display normalization in non-file:// local-link parsing.
  • Keep fallback behavior: if decoded bytes are not valid UTF-8, return original text.
  • Added regression tests in both test files:
    • file_link_decodes_percent_encoded_path_text
    • file_link_preserves_invalid_percent_sequences

Validation passed:

  • cargo test -p codex-tui markdown_render_tests::file_link_
  • cargo test -p codex-tui-app-server markdown_render_tests::file_link_
  • Manual CLI/TUI check:
    • /Users/.../random_%C3%9F.md:1 renders as /Users/.../random_ß.md:1
    • %E6%ZZ remains %E6%ZZ

Activity

  1. added
    app
    on Mar 23, 2026
  2. added
    bug
    TUI
    on Mar 23, 2026
  3. github-actions commented on Mar 23, 2026

    @github-actions
    Contributor
  4. removed
    TUI
    on Mar 23, 2026
  5. mle-foo commented on Mar 26, 2026

    @mle-foo

    Draft PR opened with a scoped fix and regression tests: #15816

  6. huseyinkaplandev commented on Apr 24, 2026

    @huseyinkaplandev

    Confirmed on Windows as well.

    I can reproduce the same rendering inconsistency for percent-encoded UTF-8 local paths in transcript output:

    • status/patch layer shows decoded text
    • output layer may keep encoded text (e.g. %C3%9F)

    Expected behavior:

    • valid %XX UTF-8 sequences decoded for display
    • invalid sequences preserved as-is
    • consistent rendering across status/output layers

    If needed, I can provide app version + exact repro logs from my environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appartifacts-in-codexbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions