Mobile Remote: Android Remote should preserve host provider config
Summary
Mobile Remote sessions created from Android Remote can ignore the host's local provider configuration because the phone request sends modelProvider=openai as an explicit default. That value can override the host-side config/thread-config result, so a phone-created session may use ChatGPT/OpenAI auth and quota even when the host is configured to use a custom/local provider.
I tried to open this as a PR, but openai/codex currently only allows collaborators to create pull requests against the upstream repository from my fork. I am filing the issue with the patch branch details instead.
Observed behavior
A phone-created session from codex_chatgpt_android_remote persisted with:
model_provider=openai- ChatGPT websocket auth path
This happened even though the host-side local config/thread-config provider was returning the intended custom provider for new sessions.
Expected behavior
When Android Remote sends the default provider value openai, app-server should treat that as "no explicit provider override" so the host's configured provider/thread-config can win.
If Android Remote sends a non-default provider value, that explicit override should still be preserved.
Patch branch
- Branch:
HanCheg0812/codex:codex/android-remote-provider-config - Commit:
b28593e6c5fbf3a030b9ad83d7a1b3b8d85937308 - Compare: https://github.com/openai/codex/compare/main...HanCheg0812:codex/android-remote-provider-config?expand=1
The change is limited to:
codex-rs/app-server/src/request_processors/thread_processor.rscodex-rs/app-server/src/request_processors/thread_processor_tests.rs
Validation
On the patch branch I ran:
cargo test -p codex-app-server normalize_thread_start_model_provider_drops_android_remote_openai_default
cargo build -p codex-app-server
Both passed locally.
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This is a good place to preserve host authority explicitly. If the Android Remote value is only the client default, treating
modelProvider=openaias an explicit override changes who owns execution policy: the phone ends up forcing provider/auth/quota semantics instead of the host config deciding them.I would expect the thread-start path to distinguish three cases:
It would also help to emit the resolved provider in a thread-start receipt, so mobile users can see whether a session is using host config or a phone-side override before work starts consuming the wrong quota.
That matches the behavior I observed locally. Android Remote was sending
modelProvider=openaias part of the thread-start payload, and the app-server treated that as an explicit override. The result was that a host configured for a custom provider still created phone-started threads withmodel_provider=openai, so execution went through the ChatGPT/OpenAI provider path and quota instead of the host's configured provider.The fix I was testing is aligned with your three-case split: normalize the Android Remote default OpenAI value as “no client provider override”, then let the host/thread config resolve the provider; still preserve a deliberate non-default client-side provider choice.
I also agree that returning the resolved provider in a thread-start receipt would be useful. It would make the ownership boundary visible before work starts, especially for mobile sessions where the user may not realize whether execution is using host config or a phone-side override.