Skip to content

fix(exec): improve stdin prompt decoding#9151

Merged
etraut-openai merged 2 commits intoopenai:mainfrom
liqiongyu:fix/exec-stdin-utf8
Jan 15, 2026
Merged

fix(exec): improve stdin prompt decoding#9151
etraut-openai merged 2 commits intoopenai:mainfrom
liqiongyu:fix/exec-stdin-utf8

Conversation

@liqiongyu
Copy link
Copy Markdown
Contributor

Fixes #8733.

  • Read prompt from stdin as raw bytes and decode more helpfully.
  • Strip UTF-8 BOM; decode UTF-16LE/UTF-16BE when a BOM is present.
  • For other non-UTF8 input, fail with an actionable message (offset + iconv hint).

Tests: cargo test -p codex-exec.

@etraut-openai
Copy link
Copy Markdown
Collaborator

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 104f01baaf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/exec/src/lib.rs Outdated
@etraut-openai
Copy link
Copy Markdown
Collaborator

Thanks for the contribution. Please see the code review feedback from Codex. I think it's highlighting a legitimate problem.

@etraut-openai etraut-openai added the needs-response Additional information is requested label Jan 13, 2026
@liqiongyu liqiongyu force-pushed the fix/exec-stdin-utf8 branch from 591679d to 9c4863b Compare January 14, 2026 02:50
@liqiongyu
Copy link
Copy Markdown
Contributor Author

liqiongyu commented Jan 14, 2026

Addressed the automated review feedback: check for UTF-32 BOMs before UTF-16 so UTF-32 input fails fast with the intended unsupported-encoding error. Added UTF-16BE + UTF-32LE/BE tests.

Tests: cargo test -p codex-exec; just fix -p codex-exec.

@etraut-openai etraut-openai removed the needs-response Additional information is requested label Jan 14, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator

jif-oai commented Jan 15, 2026

@codex review

1 similar comment
@jif-oai
Copy link
Copy Markdown
Collaborator

jif-oai commented Jan 15, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai etraut-openai merged commit b4d240c into openai:main Jan 15, 2026
26 of 32 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to read prompt from stdin: stream did not contain valid UTF-8

3 participants