What version of Codex CLI is running?
codex-cli 0.98.0
What subscription do you have?
Plus
Which model were you using?
All
What platform is your computer?
Linux 6.1.145-android14-11-gb812b232b095-ab14605088 aarch64 unknown
What terminal emulator and version are you using (if applicable)?
Termux 0.119.0-beta.3
What issue are you seeing?
Codex CLI does not function correctly on **native Termux / Android**. There are multiple related failure modes.
---
### 1) Authentication fails
Both authentication flows fail:
- **Sign in with ChatGPT**
- **Sign in with Device Code**
The failure manifests as:
`Stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)`
`strace` indicates resolver-related activity and DNS traffic toward `127.0.0.1:53`. This environment does not provide a traditional `/etc/resolv.conf`, which is typical for Android.
Because authentication fails, Codex cannot complete the initial login flow on Termux.
#### Workaround
If `~/.codex/auth.json` is generated on another system and copied into Termux, authentication succeeds.
Similarly, if `auth.json` was created previously, Codex can start.
However:
Once a valid `auth.json` is present, the same request failure appears during interactive use (e.g. `codex exec "hello"` or starting a session).
So the resolver issue affects both:
- authentication
- normal request execution
---
### 2) Startup lock errors (non-fatal)
On startup, Codex emits lock-related errors consistent with file-lock operations not being supported in this environment. The errors are of the form:
`std::fs::TryLockError::Error(err)` where `err.kind() == std::io::ErrorKind::Unsupported`
Importantly:
- These errors do **not** crash the application.
- Codex continues running.
- No obvious functionality appears broken solely due to these startup lock errors.
---
### 3) Session preference does not persist when pressing `p`
When Codex prompts for permission to perform an action, it offers an option to press `p` to auto-accept for the rest of the session.
On Termux:
- Pressing `p` triggers the same lock-related failure.
- The preference does not persist.
- Codex continues prompting instead of remembering the choice.
This appears related to the unsupported lock behavior described above.\
What steps can reproduce the bug?
Authentication failure path
- Use Android + Termux (native Termux; no proot/chroot).
- Install and run Codex CLI.
- Attempt either:
- "Sign in with ChatGPT"
- "Sign in with Device Code"
- Observe request failure:
Stream disconnected before completion: error sending request for url (...)
Optional:
- Run
strace and observe resolver-related calls / DNS attempts toward 127.0.0.1:53.
Interactive failure path (after auth workaround)
- Copy a valid
~/.codex/auth.json from another system into Termux.
- Run
codex exec "hello" or start an interactive session.
- Observe the same request failure described above.
Lock persistence failure path
If you manage to work around the DNS issues - i.e. have root access and are able to make a /etc/resolv.conf:
- Use Android + Termux.
- Run Codex CLI until a permission prompt appears.
- Press
p to auto-accept for the rest of the session.
- Observe lock-related error(s) and that the preference does not persist.
What is the expected behavior?
Codex CLI should function on native Termux/Android, including:
- Successful authentication.
- Successful request execution.
- No lock-related errors on startup.
- Session-level preference toggles (like “auto-accept for rest of session”) should work or degrade gracefully.
Additional information
What version of Codex CLI is running?
codex-cli 0.98.0
What subscription do you have?
Plus
Which model were you using?
All
What platform is your computer?
Linux 6.1.145-android14-11-gb812b232b095-ab14605088 aarch64 unknown
What terminal emulator and version are you using (if applicable)?
Termux 0.119.0-beta.3
What issue are you seeing?
Codex CLI does not function correctly on **native Termux / Android**. There are multiple related failure modes.
---
### 1) Authentication fails
Both authentication flows fail:
- **Sign in with ChatGPT**
- **Sign in with Device Code**
The failure manifests as:
`Stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)`
`strace` indicates resolver-related activity and DNS traffic toward `127.0.0.1:53`. This environment does not provide a traditional `/etc/resolv.conf`, which is typical for Android.
Because authentication fails, Codex cannot complete the initial login flow on Termux.
#### Workaround
If `~/.codex/auth.json` is generated on another system and copied into Termux, authentication succeeds.
Similarly, if `auth.json` was created previously, Codex can start.
However:
Once a valid `auth.json` is present, the same request failure appears during interactive use (e.g. `codex exec "hello"` or starting a session).
So the resolver issue affects both:
- authentication
- normal request execution
---
### 2) Startup lock errors (non-fatal)
On startup, Codex emits lock-related errors consistent with file-lock operations not being supported in this environment. The errors are of the form:
`std::fs::TryLockError::Error(err)` where `err.kind() == std::io::ErrorKind::Unsupported`
Importantly:
- These errors do **not** crash the application.
- Codex continues running.
- No obvious functionality appears broken solely due to these startup lock errors.
---
### 3) Session preference does not persist when pressing `p`
When Codex prompts for permission to perform an action, it offers an option to press `p` to auto-accept for the rest of the session.
On Termux:
- Pressing `p` triggers the same lock-related failure.
- The preference does not persist.
- Codex continues prompting instead of remembering the choice.
This appears related to the unsupported lock behavior described above.\
What steps can reproduce the bug?
Authentication failure path
Stream disconnected before completion: error sending request for url (...)Optional:
straceand observe resolver-related calls / DNS attempts toward127.0.0.1:53.Interactive failure path (after auth workaround)
~/.codex/auth.jsonfrom another system into Termux.codex exec "hello"or start an interactive session.Lock persistence failure path
If you manage to work around the DNS issues - i.e. have root access and are able to make a /etc/resolv.conf:
pto auto-accept for the rest of the session.What is the expected behavior?
Codex CLI should function on native Termux/Android, including:
Additional information
docs/contributing.mdindicates external PRs are invitation-only, I’m reporting this first. I’m happy to open a PR if invited, as I've already got one drafted against my fork here Fix Termux/Android compatibility issues (DNS, locking, Android target support) wallentx/codex-termux#5