Commit c5940b7
committed
fix(selfhost): give structural AI-provider config errors a long circuit-breaker cooldown
A provider failing for a structural reason (missing/invalid credentials, e.g.
codex_auth_not_configured/codex_no_auth) fails identically on every attempt, but the
per-provider circuit breaker treated it like any transient outage: 3 failures to open,
60s cooldown, then one real attempt let through to re-fail and reopen -- forever, every
60s, with no chance of the underlying config ever fixing itself. Confirmed live
(GITTENSORY-K/8): a container with codex's credential file never present generated
2094 + 544 Sentry events over 16 days under exactly this pattern.
Structural failures now open the circuit on the first failure (no reason to pay for 3
real attempts when the outcome is deterministic) at a 1-hour cooldown instead of 60s
(still re-checks periodically so a fixed credential is picked up without a restart, but
stops hammering a known-broken provider on every incoming review). The retry loop inside
a single review (runWorkersOpinion and the dual-AI tie-break judge call) also fast-breaks
on a structural error after one attempt instead of burning its full 3-attempt budget,
matching the existing subscription-timeout/rate-limit fast-break.1 parent a8d168d commit c5940b7
4 files changed
Lines changed: 140 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
1148 | 1149 | | |
1149 | 1150 | | |
1150 | 1151 | | |
1151 | | - | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1152 | 1163 | | |
1153 | 1164 | | |
1154 | 1165 | | |
| |||
1250 | 1261 | | |
1251 | 1262 | | |
1252 | 1263 | | |
1253 | | - | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
1254 | 1267 | | |
1255 | 1268 | | |
1256 | 1269 | | |
| |||
1290 | 1303 | | |
1291 | 1304 | | |
1292 | 1305 | | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
1293 | 1309 | | |
1294 | 1310 | | |
1295 | | - | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
1296 | 1316 | | |
1297 | 1317 | | |
1298 | 1318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1020 | 1020 | | |
1021 | 1021 | | |
1022 | 1022 | | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1023 | 1035 | | |
1024 | 1036 | | |
1025 | 1037 | | |
| |||
1148 | 1160 | | |
1149 | 1161 | | |
1150 | 1162 | | |
1151 | | - | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
1152 | 1167 | | |
1153 | 1168 | | |
1154 | 1169 | | |
| |||
1859 | 1874 | | |
1860 | 1875 | | |
1861 | 1876 | | |
1862 | | - | |
1863 | | - | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
1864 | 1880 | | |
1865 | 1881 | | |
1866 | 1882 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
2877 | 2878 | | |
2878 | 2879 | | |
2879 | 2880 | | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
2880 | 2896 | | |
2881 | 2897 | | |
2882 | 2898 | | |
| |||
3043 | 3059 | | |
3044 | 3060 | | |
3045 | 3061 | | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
3046 | 3087 | | |
3047 | 3088 | | |
3048 | 3089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
738 | 795 | | |
739 | 796 | | |
740 | 797 | | |
| |||
0 commit comments