App crashes on startup with "Invalid weekday string: SUN" on non-English macOS locale

Open 💬 1 comment Opened Jun 28, 2026 by Davidzw211

Body:

## Bug Report

### Description

Codex desktop app fails to start on macOS with a non-English locale (e.g.
zh-Hans_US).
The app crashes immediately with SyntaxError: Invalid weekday string: SUN
before any UI is shown.

### Environment

  • Codex version: 26.623.42026
  • macOS version: 26.2 (Darwin 25.2.0, Apple Silicon)
  • System locale: zh-Hans_US
  • locale output:

LANG="C.UTF-8"
LC_TIME="C.UTF-8"

  • defaults read -g AppleLocale: zh-Hans_US

### Steps to Reproduce

  1. Set macOS system language to Chinese (Simplified) — zh-Hans_US
  2. Install Codex desktop app
  3. Launch Codex

### Expected Behavior

App starts normally.

### Actual Behavior

App crashes immediately with the following error dialog:

> Codex failed to start.
> Invalid weekday string: SUN

Full error:

SyntaxError: Invalid weekday string: SUN
at .vite/build/src-C3H9d_bd.js:394:1534
at Array.map ()
at Rk (.vite/build/src-C3H9d_bd.js:394:1421)
at .vite/build/src-C3H9d_bd.js:394:1041
at Array.forEach ()
at Fk (.vite/build/src-C3H9d_bd.js:394:647)
at Pk (.vite/build/src-C3H9d_bd.js:394:379)
at Array.map ()
at Mk (.vite/build/src-C3H9d_bd.js:394:4)
at .vite/build/src-C3H9d_bd.js:395:14524

### Root Cause

The rrule library used internally only accepts 2-letter weekday strings
as defined in RFC 5545 (MO, TU, WE, TH, FR, SA, SU). However, on
zh-Hans_US locale, macOS returns 3-letter abbreviations (SUN, MON,
TUE, etc.) when querying calendar/weekday information.

The mismatch occurs in the weekday parsing function (named Rk in the
minified build):

``javascript
// Current code — only handles 2-letter format
function Rk(e) {
return e.split(',').map(function(e) {
if (e.length === 2) return yA[e]; // yA = {MO, TU, WE, TH, FR, SA, SU}
var t = e.match(/^([+-]?\d{1,2})([A-Z]{2})$/);
if (!t || t.length < 3) throw SyntaxError(
Invalid weekday string: ${e}`);
// ...
});
}

The same bug exists in 4 files within app.asar:

  • .vite/build/src-C3H9d_bd.js
  • .vite/build/worker.js
  • .vite/build/child-process-snapshot-worker.js
  • webview/assets/app-initial~app-main~onboarding-page-BUwCKIcU.js

Suggested Fix

Add a 3-letter → 2-letter normalization step before the existing check:

function Rk(e) {
return e.split(',').map(function(e) {
var _w3 = {SUN:'SU', MON:'MO', TUE:'TU', WED:'WE', THU:'TH', FRI:'FR',
SAT:'SA'};
if (_w3[e]) e = _w3[e]; // normalize 3-letter to 2-letter
if (e.length === 2) return yA[e];
var t = e.match(/^([+-]?\d{1,2})([A-Z]{2})$/);
if (!t || t.length < 3) throw SyntaxError(Invalid weekday string: ${e});
// ...
});
}

This fix has been verified to resolve the crash on zh-Hans_US locale.

Workaround

Manually patch app.asar inside the installed app bundle with the fix above.

---

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗