Brennan Benson
7ae6aedc02
fix(codex): stop a transient filesystem error from logging out the active account ( #15046 )
...
* fix(codex): stop a transient filesystem error from logging out the active account
A single unreadable read of a managed Codex home's ownership marker cleared the
user's active account selection, permanently. On Windows any exclusive lock —
Defender real-time scanning, a backup agent, a sync client — makes every read of
that marker fail with EBUSY, and the background rate-limit poll runs every 15
minutes plus once at every app start.
Root cause: the ownership gate answered two very different questions through one
channel. "This home is not ours" (a successful observation that failed a trust
check) and "we could not read it" both surfaced as a throw, which the caller
flattened to null, which three call sites took as proof the home was
untrustworthy and wrote activeCodexManagedAccountId: null.
Refusing to USE an unverified home is correct. Erasing the user's account
selection because a file was briefly locked is not.
The gate now returns a tri-state verdict. `untrusted` comes only from a proven
trust failure or a definitive ENOENT/ENOTDIR where absence is itself the
verdict; every other filesystem exception is `indeterminate`. Only `untrusted`
may touch persisted state.
Because `null` already meant "fall through to the system default" on both the
launch and poll paths, not-clearing on its own would have run a DIFFERENT
account behind a UI still showing the selected one. So the refusal needed real
channels rather than a sentinel:
- the poll returns an explicit skip; returning null would not have skipped at
all, since the fetcher maps null to ~/.codex and would have spawned a
token-refreshing app-server inside the user's real credential home
- pane launch throws a typed temporary-unavailability error that both PTY
implementations convert into a clean refusal with a retry message, including
the re-resolution after the async auth-readiness wait
- automatic session resume resolves the selected home eagerly, so an unreadable
account can no longer be silently replaced by another one in the ranking
- config-sync status reports a distinct managed-home-unavailable stall instead
of "synced", with a bounded renderer retry so it clears on its own
Also fixes the ticket's second symptom. The status bar's Sign in button called a
re-auth that captured the selection before login and restored it after, so
re-authenticating a deselected account restored `null` — a successful login that
left the account inactive, with no success toast to distinguish it from failure.
It now activates the account it just signed in, but only when the pre-login
selection was empty, so it cannot silently switch accounts for multi-account
users, and it runs the same restart prompt an explicit switch does.
No retry or grace window inside the synchronous gate: it runs on the Electron
main process in a loop over accounts, so a sleep there would freeze the UI.
Recovery is simply the next readable evaluation.
The WSL lane has the same class of defect, including one path that deletes a
credential mirror. It is pre-existing, unreachable from these host code paths,
and deliberately left for its own change; the host clearing sites cannot reach a
WSL account because getSelfContainedManagedHostAccount excludes them.
Fixes STA-4422
* test(codex): cover pending reset home ownership
2026-08-17 02:19:57 -07:00
..
2026-08-16 21:58:28 -07:00
2026-08-15 18:33:33 -07:00
2026-08-15 18:25:37 -07:00
2026-08-15 18:25:37 -07:00
2026-08-11 12:13:16 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-16 20:35:34 -07:00
2026-08-16 21:58:28 -07:00
2026-08-16 13:45:54 -07:00
2026-08-15 18:33:33 -07:00
2026-08-15 00:54:20 -07:00
2026-08-17 02:19:57 -07:00
2026-08-17 02:19:57 -07:00
2026-08-03 23:25:14 -07:00
2026-08-15 18:33:33 -07:00
2026-08-16 20:48:26 -07:00
2026-08-15 00:41:45 -07:00
2026-08-15 18:25:37 -07:00
2026-08-17 00:11:19 -07:00
2026-08-16 20:48:26 -07:00
2026-08-16 23:51:53 -07:00
2026-08-14 12:50:35 -07:00
2026-07-23 18:35:31 -07:00
2026-08-16 20:48:26 -07:00
2026-08-12 13:02:23 -07:00
2026-08-16 20:48:26 -07:00
2026-08-16 20:49:45 -07:00
2026-08-17 00:12:14 -07:00
2026-08-13 22:48:24 -07:00
2026-08-17 00:12:14 -07:00
2026-08-15 18:17:20 -07:00
2026-08-16 20:48:26 -07:00
2026-07-10 00:11:27 -07:00
2026-07-30 19:33:05 -07:00
2026-08-15 18:25:37 -07:00
2026-07-29 17:44:41 -07:00
2026-08-17 02:19:57 -07:00
2026-08-15 18:17:20 -07:00
2026-08-11 18:19:43 -07:00
2026-08-13 22:48:24 -07:00
2026-07-23 18:35:31 -07:00
2026-08-15 18:17:20 -07:00
2026-07-27 16:36:39 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-16 12:33:28 -07:00
2026-08-11 18:19:43 -07:00
2026-08-13 22:09:23 -07:00
2026-08-11 18:19:43 -07:00
2026-08-11 18:19:43 -07:00
2026-08-16 12:33:28 -07:00
2026-08-15 18:33:33 -07:00
2026-08-14 22:18:36 -07:00
2026-08-16 22:22:09 -07:00
2026-08-11 22:34:54 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 20:44:16 -07:00
2026-08-13 22:48:24 -07:00
2026-08-16 23:51:53 -07:00
2026-08-15 19:36:03 -07:00
2026-08-17 02:19:57 -07:00
2026-08-17 01:50:17 -07:00
2026-07-21 18:23:20 -07:00
2026-08-17 00:55:04 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-11 01:48:14 -07:00
2026-08-17 01:50:17 -07:00
2026-08-15 00:54:20 -07:00
2026-08-16 13:45:54 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-17 02:19:57 -07:00
2026-07-24 19:54:25 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-16 23:51:53 -07:00
2026-07-20 01:14:17 -07:00
2026-08-01 19:22:39 -07:00
2026-07-23 18:35:31 -07:00
2026-08-13 22:48:24 -07:00
2026-08-01 19:22:39 -07:00
2026-08-01 19:22:39 -07:00
2026-08-09 22:52:11 -07:00
2026-08-09 22:52:11 -07:00
2026-07-23 06:22:56 -07:00
2026-07-23 06:22:56 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-06-22 18:01:37 -07:00
2026-06-22 18:01:37 -07:00
2026-07-17 15:27:39 -07:00
2026-07-17 15:27:39 -07:00
2026-07-24 19:54:25 -07:00
2026-07-24 19:54:25 -07:00
2026-08-16 12:48:53 -07:00
2026-07-29 21:43:45 -07:00
2026-07-29 21:43:45 -07:00
2026-07-26 00:13:48 -07:00
2026-07-26 00:13:48 -07:00
2026-08-01 19:22:39 -07:00
2026-08-01 13:38:45 -07:00
2026-08-15 18:25:37 -07:00
2026-08-14 19:04:54 -04:00
2026-08-14 19:04:55 -04:00
2026-08-13 22:48:24 -07:00
2026-06-30 11:31:55 -07:00
2026-08-14 19:04:55 -04:00
2026-08-14 19:04:55 -04:00
2026-08-13 16:23:22 -07:00
2026-08-14 19:04:55 -04:00
2026-08-14 19:04:54 -04:00
2026-08-14 19:04:55 -04:00
2026-08-14 19:04:55 -04:00
2026-08-13 16:23:21 -07:00
2026-08-13 16:23:21 -07:00
2026-06-30 11:31:55 -07:00
2026-08-01 13:38:45 -07:00
2026-08-01 13:38:45 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-13 22:48:24 -07:00
2026-08-02 17:40:58 -07:00
2026-08-02 17:40:58 -07:00
2026-08-16 13:51:04 -07:00
2026-06-19 17:14:55 -07:00
2026-08-15 18:25:37 -07:00
2026-08-15 18:25:37 -07:00
2026-08-15 18:25:37 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 18:25:37 -07:00
2026-08-15 18:25:37 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 18:25:37 -07:00
2026-08-15 18:25:37 -07:00
2026-07-29 18:21:26 -07:00
2026-08-17 02:19:57 -07:00
2026-08-11 17:29:22 -07:00
2026-08-15 18:25:37 -07:00
2026-08-01 13:38:45 -07:00
2026-08-12 14:31:42 -07:00
2026-08-12 14:31:42 -07:00
2026-08-02 20:46:49 -07:00
2026-08-13 22:48:24 -07:00
2026-08-02 20:46:49 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-02 20:46:49 -07:00
2026-08-13 22:48:24 -07:00
2026-07-18 23:01:29 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-08-13 22:48:24 -07:00
2026-07-23 18:35:31 -07:00
2026-07-29 18:21:26 -07:00
2026-07-10 17:52:50 -07:00
2026-07-15 15:23:35 -07:00
2026-08-13 22:48:24 -07:00
2026-07-06 16:43:05 -07:00
2026-07-06 16:43:05 -07:00
2026-07-31 00:51:39 -07:00
2026-07-31 00:51:39 -07:00
2026-07-31 00:51:39 -07:00
2026-07-31 00:51:39 -07:00
2026-07-28 15:34:52 -07:00
2026-07-28 15:34:52 -07:00
2026-08-03 23:11:36 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-16 22:22:09 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-06 21:19:04 -07:00
2026-08-06 21:19:04 -07:00
2026-08-06 21:19:04 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-07-27 01:14:33 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-16 13:45:54 -07:00
2026-08-06 21:19:04 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-16 22:22:09 -07:00
2026-08-14 22:18:36 -07:00
2026-08-15 21:41:01 -07:00
2026-08-15 21:41:01 -07:00
2026-07-31 11:58:46 -07:00
2026-08-13 17:02:28 -07:00
2026-08-13 17:02:28 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-06 21:19:04 -07:00
2026-08-06 21:19:04 -07:00
2026-08-14 19:04:55 -04:00
2026-08-14 19:04:55 -04:00
2026-07-25 22:28:07 -07:00
2026-07-25 22:28:07 -07:00
2026-08-07 21:59:24 -07:00
2026-08-07 21:59:24 -07:00
2026-08-01 19:22:39 -07:00
2026-07-23 18:03:43 -07:00
2026-07-23 18:03:43 -07:00
2026-08-01 19:22:39 -07:00
2026-08-04 01:37:25 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-14 21:36:09 -07:00
2026-08-14 21:36:09 -07:00
2026-07-25 04:04:19 -07:00
2026-07-25 04:04:19 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-16 22:05:46 -07:00
2026-08-16 22:05:46 -07:00
2026-08-16 22:05:46 -07:00
2026-08-16 22:05:46 -07:00
2026-06-29 22:38:29 -07:00
2026-07-09 16:24:20 -07:00
2026-08-13 22:48:24 -07:00
2026-07-20 14:34:53 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-08-15 18:25:37 -07:00
2026-08-15 18:25:37 -07:00
2026-08-12 14:31:42 -07:00
2026-08-12 14:31:42 -07:00
2026-08-12 20:55:29 -07:00
2026-08-12 14:31:42 -07:00
2026-08-12 14:31:42 -07:00
2026-08-12 20:55:29 -07:00
2026-08-12 20:55:29 -07:00
2026-08-16 23:51:53 -07:00
2026-08-13 23:47:20 -07:00
2026-07-10 17:27:47 -07:00
2026-08-13 22:48:24 -07:00
2026-08-09 13:31:22 -07:00
2026-08-09 13:31:22 -07:00
2026-08-05 01:13:13 -07:00
2026-08-05 01:13:13 -07:00
2026-08-05 01:13:13 -07:00
2026-08-05 01:13:13 -07:00
2026-07-29 18:21:26 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-07-11 21:03:04 -07:00
2026-07-11 21:03:04 -07:00
2026-07-23 18:35:31 -07:00
2026-08-13 22:48:24 -07:00
2026-08-02 20:46:49 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-07-17 15:27:39 -07:00
2026-07-17 15:27:39 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-07-23 18:35:31 -07:00
2026-07-28 19:58:58 -07:00
2026-07-28 19:58:58 -07:00
2026-07-28 19:58:58 -07:00
2026-07-28 19:58:58 -07:00
2026-08-09 19:01:35 -07:00
2026-07-31 14:29:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-07-28 19:58:58 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-13 22:48:24 -07:00
2026-07-22 18:52:37 -07:00
2026-08-04 02:02:53 -07:00
2026-08-15 00:54:20 -07:00
2026-07-09 23:00:01 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-15 00:54:20 -07:00
2026-08-13 22:48:24 -07:00
2026-07-29 18:21:26 -07:00
2026-08-15 00:38:13 -07:00
2026-08-15 00:38:13 -07:00
2026-07-11 02:03:14 -07:00
2026-08-01 13:38:45 -07:00
2026-08-01 13:38:45 -07:00
2026-08-10 19:55:29 -07:00
2026-07-24 00:27:40 -07:00
2026-07-24 00:27:40 -07:00
2026-07-25 22:28:07 -07:00
2026-07-25 22:28:07 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 23:47:20 -07:00
2026-08-13 22:48:24 -07:00
2026-07-04 21:31:51 -07:00
2026-07-04 21:31:51 -07:00
2026-08-14 22:18:36 -07:00
2026-08-14 22:18:36 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-17 01:23:08 -07:00
2026-08-17 01:23:08 -07:00
2026-07-23 18:35:31 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-15 18:25:37 -07:00
2026-08-13 22:48:24 -07:00
2026-08-13 22:48:24 -07:00
2026-08-07 20:35:22 -07:00
2026-08-07 21:59:24 -07:00
2026-07-19 17:31:34 -07:00
2026-08-07 20:35:22 -07:00
2026-07-30 17:49:32 -07:00
2026-07-30 17:49:32 -07:00
2026-07-30 17:49:32 -07:00
2026-07-14 15:23:06 -07:00
2026-08-16 23:51:53 -07:00
2026-08-16 23:51:53 -07:00
2026-08-07 20:35:22 -07:00
2026-08-07 20:35:22 -07:00
2026-08-07 20:35:22 -07:00
2026-08-07 20:35:22 -07:00
2026-08-09 19:52:16 -07:00
2026-08-14 22:18:36 -07:00
2026-08-16 23:51:53 -07:00