Commit 8d36a74
committed
fix: 4 bugs found during deep stress test
[MEDIUM] lib/storage/flagged-storage.ts: normalizeFlaggedStorage was silently
dropping workspaces, currentWorkspaceIndex, accessToken, and expiresAt from
flagged accounts, defeating the Zod schema's .passthrough() intent and causing
multi-workspace accounts to permanently lose their workspace list after a
flag/restore round-trip.
[MEDIUM] lib/codex-manager/login-menu-data.ts: refreshQuotaCacheForMenu had a
dead catch block because loadQuotaCache() never throws — it returns empty maps
on any read failure. When the persisted cache came back empty (e.g. transient
lock), only this run's probed entries were saved, wiping all other accounts'
still-valid quota data. Fixed by explicitly detecting the empty-load case and
falling back to nextCache (the full in-memory clone).
[HIGH] lib/runtime-rotation-proxy.ts: persistRuntimeActiveAccount advanced the
sequential drain-first pointer via markSwitchedLocked in the legacy routing
branch even when schedulingStrategy was 'sequential', defeating the #509
invariant. Added the same schedulingStrategy !== 'sequential' guard that the
enabled branch already had.
[MEDIUM] lib/runtime/rotation-token-refresh.ts: ensureFreshAccessToken could
return an expired access token when commitRefreshedAuthOnce returned null
(account missing from storage after persist), because updatedAccount fell back
to the original account which still carried the old token. Fixed to use
refreshResult.access (the just-issued token) in the null-commit case, while
preserving the committed account's stored token on the success path (required
for the dedup-commit case where two concurrent callers share one commit).1 parent e453111 commit 8d36a74
4 files changed
Lines changed: 66 additions & 16 deletions
File tree
- lib
- codex-manager
- runtime
- storage
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
222 | 228 | | |
223 | 229 | | |
224 | 230 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
233 | 245 | | |
234 | | - | |
| 246 | + | |
235 | 247 | | |
236 | | - | |
237 | | - | |
| 248 | + | |
| 249 | + | |
238 | 250 | | |
239 | 251 | | |
240 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| 296 | + | |
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
| |||
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
322 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
323 | 333 | | |
324 | 334 | | |
325 | 335 | | |
| |||
1349 | 1359 | | |
1350 | 1360 | | |
1351 | 1361 | | |
| 1362 | + | |
1352 | 1363 | | |
1353 | 1364 | | |
1354 | 1365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
126 | 138 | | |
127 | 139 | | |
128 | | - | |
129 | | - | |
| 140 | + | |
| 141 | + | |
130 | 142 | | |
131 | 143 | | |
132 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| |||
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
116 | 131 | | |
117 | 132 | | |
118 | 133 | | |
| |||
0 commit comments