Skip to content

AGENTS.md is silently ignored when invalid utf8 characters are present #23223

@runfence

Description

@runfence

What version of Codex CLI is running?

0.130.0

What subscription do you have?

Pro

What platform is your computer?

Windows

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

Windows Terminal (PowerShell)

Codex doctor report

error: unexpected argument '--json' found

What issue are you seeing?

c:\Users\USERNAME\.codex\AGENTS.md is not injected into context after I accidentally put invalid utf8 characters into the text there.

What steps can reproduce the bug?

Edit the file with wrong encoding, add some quotes that read as ? when opened back in utf8.

Uploaded thread: 019e38be-0085-7450-9591-5828b2035e64

What is the expected behavior?

c:\Users\USERNAME\.codex\AGENTS.md is injected into context, merged with project level AGENTS.md if exists. If invalid characters prevent this from working, a clear error message should show it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatescontextIssues related to context management (including compaction)windows-osIssues related to Codex on Windows systems

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions