auth command called too frequently (upon conversation switch)
Open 💬 0 comments Opened Aug 11, 2026 by rwalle
What version of the Codex App are you using (From “About Codex” dialog)?
26.727.51351
What subscription do you have?
Azure
What platform is your computer?
Darwin 25.5.0 arm64 arm
What issue are you seeing?
We have an internal OpenAI endpoint that is based on Azure Foundry, and we have a service that issues token dynamically. For Codex app/ChatGPT, we are using "auth command" as in mentioned in Custom Model Providers, and more specifically this
[model_providers.proxy.auth]
command = "/usr/local/bin/fetch-codex-token"
args = ["--audience", "codex"]
timeout_ms = 5000
refresh_interval_ms = 300000
Despite setting up a refresh_interval_ms, we noticed that this command is called too frequently -- it is called whenever user switches to a different conversation. This could result in excessive amount of requests for new tokens
What steps can reproduce the bug?
- set up the "command" as in the doc and above and point to a command that prints token while does logging
- launch ChatGPT/Codex app, and switch between conversations
- observe logs
What is the expected behavior?
the command is only run when
- a token is first obtained
- existing token expires after TTL
- application sees a 401 error
Additional information
_No response_