Commit e4458b8
fix(codex): prevent infinite loop when fetching models on settings screen
When Codex is not connected/authenticated, the /api/codex/models endpoint
returns 503. The fetchCodexModels function had no cooldown after failures,
causing infinite retries when navigating to the Settings screen.
Added codexModelsLastFailedAt state to track failed fetch attempts and
skip retries for 30 seconds after a failure. This prevents the infinite
loop while still allowing periodic retry attempts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent f3f5d05 commit e4458b8
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
692 | 693 | | |
693 | 694 | | |
694 | 695 | | |
| |||
1286 | 1287 | | |
1287 | 1288 | | |
1288 | 1289 | | |
| 1290 | + | |
1289 | 1291 | | |
1290 | 1292 | | |
1291 | 1293 | | |
| |||
3113 | 3115 | | |
3114 | 3116 | | |
3115 | 3117 | | |
3116 | | - | |
| 3118 | + | |
3117 | 3119 | | |
3118 | 3120 | | |
3119 | 3121 | | |
3120 | 3122 | | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
3121 | 3133 | | |
3122 | 3134 | | |
3123 | 3135 | | |
| |||
3142 | 3154 | | |
3143 | 3155 | | |
3144 | 3156 | | |
| 3157 | + | |
3145 | 3158 | | |
3146 | 3159 | | |
3147 | 3160 | | |
3148 | 3161 | | |
3149 | 3162 | | |
3150 | 3163 | | |
| 3164 | + | |
3151 | 3165 | | |
3152 | 3166 | | |
3153 | 3167 | | |
| |||
0 commit comments