-
Stefy Lanza (nextime / spora ) authored
In OAuth mode _get_valid_api_key() notices the configured endpoint is not the ChatGPT backend, corrects base_url in memory and calls _update_provider_endpoint() to write the correction back. For a global provider that write called config.save_providers() -- a method that does not exist. The AttributeError was swallowed by the surrounding except and logged as a warning, so the correction only ever lived in memory: providers.json kept the wrong endpoint and every restart re-ran the same dance. codex_think sat like that, configured for api.openai.com/v1 while every request went to chatgpt.com. Rewrite providers.json in place instead, merging into the on-disk document rather than serialising the in-memory config, so a concurrent dashboard edit is not clobbered by stale state. The write goes through a temp file and os.replace() so a crash mid-write cannot truncate the config. Missing provider is now logged explicitly rather than silently creating an entry, and the except logs a traceback so the next failure of this kind is not invisible. Bump version to 0.99.92. Co-Authored-By:Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c72b8a07