[Bug] Malformed Codex managed OAuth marker can block provider switching
Version
v3.20.3
Operating System
Windows
Affected App
Codex
Steps to Reproduce
- Use a valid managed ChatGPT OAuth account with an Official Codex provider.
- Keep the native Codex
auth.jsonvalid. - Make
codex_managed_oauth_live_auth.jsoncontain malformed JSON. - Switch from the Official provider to another Codex provider.
The switch fails with an error like:
JSON parse error: ...codex_managed_oauth_live_auth.json: expected value at line 1 column 1
With CC Switch fully stopped, moving only the malformed marker aside and restarting restores the Official account state and provider switching.
Expected Behavior
A malformed ownership marker should not block provider switching. It should be treated as unable to prove managed credential ownership.
Actual Behavior
Current main propagates the marker parse error through:
prepare_live_auth_for_account_switch_away
→ read_managed_live_auth_refresh_for_account
→ read_codex_live_auth_refresh_for_managed_account
→ migrate_legacy_codex_managed_oauth_live_auth_marker
→ read_json_file(marker)?
Other marker-handling paths already treat an unreadable marker as unable to establish ownership.
Related Issue
#7232 covers a missing marker; this bug requires an existing malformed marker.
Also present in current main at:
06082e189d65e6d6dbadc35dacdac1ce6c79d89a
Source: farion1231/cc-switch