install.sh fails due to overwriting variable
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
Research direction
Start with install.sh and inspect verify_archive_digest, especially how archive_path is assigned and later used. Run curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS or Linux; done means the installer no longer reports a checksum mismatch caused by variable overwriting.
Written by the indexing model from the issue text.
Description
What version of Codex CLI is running?
codex-cli 0.159.0
What subscription do you have?
Plus
Which model were you using?
No response
What platform is your computer?
Darwin 23.6.0 x86_64 i386
What terminal emulator and version are you using (if applicable)?
Ghostty 1.3.1
Codex doctor report
What issue are you seeing?
Description
The Getting Started section of the Codex CLI documentation recommends the following command for installing on macOS/Linux:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
However, this script (install.sh) has several issues. In particular, it overwrites global variables inside functions, which can cause problems.
In my environment, the following function overwrites the global variable $archive_path, which causes the problem:
verify_archive_digest() {
archive_path="$1"
expected_digest="$2"
actual_digest="$(file_sha256 "$archive_path")"
if [ "$actual_digest" != "$expected_digest" ]; then
echo "Downloaded Codex archive checksum did not match expected digest." >&2
echo "expected: $expected_digest" >&2
echo "actual: $actual_digest" >&2
return 1
fi
}
As a result, the following error occurred:
% https://learn.chatgpt.com/docs/codex/cli#getting-started
==> Installing Codex CLI
==> Detected platform: macOS (Intel)
==> Resolved version: 0.159.0
==> Downloading Codex CLI
Downloaded Codex archive checksum did not match expected digest.
expected: ab64d30288454124c7c15abd81672a9dfda7e3e723d76c4cfa6c0aba4b439017
actual: 730788ed8c1b65844546e2a34816284275b7833beb3f21eec07e38ee5497f272
WARNING: Could not download or verify https://releases.openai.com/codex/releases/0.159.0/codex-package-x86_64-apple-darwin.tar.gz; retrying from GitHub Releases.
Downloaded Codex archive checksum did not match expected digest.
expected: ab64d30288454124c7c15abd81672a9dfda7e3e723d76c4cfa6c0aba4b439017
actual: 730788ed8c1b65844546e2a34816284275b7833beb3f21eec07e38ee5497f272
Downloaded Codex archive checksum did not match expected digest.
expected: ab64d30288454124c7c15abd81672a9dfda7e3e723d76c4cfa6c0aba4b439017
actual: 730788ed8c1b65844546e2a34816284275b7833beb3f21eec07e38ee5497f272
Workaround
I applied the following ad hoc fix:
--- codex_install_orig.sh 2026-09-30 01:54:28
+++ codex_install.sh 2026-09-30 01:52:32
@@ -553,9 +553,9 @@
}
verify_archive_digest() {
- archive_path="$1"
+ archive_path_local="$1"
expected_digest="$2"
- actual_digest="$(file_sha256 "$archive_path")"
+ actual_digest="$(file_sha256 "$archive_path_local")"
if [ "$actual_digest" != "$expected_digest" ]; then
echo "Downloaded Codex archive checksum did not match expected digest." >&2
What steps can reproduce the bug?
Just do curl -fsSL https://chatgpt.com/codex/install.sh | sh
What is the expected behavior?
No response
Additional information
No response
- Dominant language
- Rust
- Stars
- 127k
- Forks
- 19.9k
- Avg merge
- 1m
- Merged PRs (30d)
- 996
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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
-
bug CLI tool-calls windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
openai/codex#49760 · 1 comment ·
Maintainers usually reply within 1 day
-
app bug session
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug CLI exec
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openai/codex#49350 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
documentation memory
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stellar/stellar-cli#2773 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
voidzero-dev/oxc-angular-compiler#511 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
yantrikos/yantrik-os#539 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
documentation station:mac ui-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
rolter-ai/rolter#2490 · 1 comment ·
Maintainers usually reply within 1 day