openai / openai/codex

[macOS][26.908.31748] Enabling Pet causes “r is not a function” AppRoutes crash; disabling Pet fixes startup

Open
#44,809 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug pets
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using?

ChatGPT/Codex Desktop 26.908.31748 (bundle identifier com.openai.codex).

Observed local Codex app-server: 0.154.0-alpha.6.1.

What subscription do you have?

ChatGPT Plus.

What platform is your computer?

macOS 26.5.1, Apple Silicon / arm64.

What issue are you seeing?

When the Codex Pet is enabled, the desktop app enters the generic “ChatGPT hit a snag” error state. Disabling/removing the Pet makes the error disappear and the app works normally.

This is reproducible and isolates the failure to the Pet/avatar overlay path in my environment.

Relevant desktop log entries:

warning [electron-message-handler] Initial route prefetch failed; rendering will retry
errorMessage="r is not a function"
errorName=Error
errorStack="Error: r is not a function"
route=primary
rendererWindowAppearance=primary

error [electron-message-handler] error boundary
errorMessage="r is not a function"
errorName=Error
errorStack="Error: r is not a function"
name=AppRoutes
rendererWindowAppearance=primary

The same AppRoutes error also occurs in the Pet overlay renderer:

error [electron-message-handler] error boundary
errorMessage="r is not a function"
errorName=Error
errorStack="Error: r is not a function"
name=AppRoutes
rendererWindowAppearance=avatarOverlay

After the renderer failure, secondary warnings appear, including:

Socket error errorCode=EPIPE errorMessage="write EPIPE"
Codex app-server is not available
Connection for host ID local not found

These occur after the initial r is not a function / AppRoutes failure.

Steps to reproduce
  1. Launch ChatGPT/Codex Desktop on macOS.
  2. Enable/show the Codex Pet.
  3. Restart/open the app with the Pet enabled.
  4. Observe the “ChatGPT hit a snag” recovery screen and AppRoutes / r is not a function errors in the desktop log.
  5. Disable/remove the Pet.
  6. Relaunch the app.
  7. The error disappears and the app works normally.

Re-enabling the Pet causes the problem to return.

Expected behavior

Enabling the Pet should not cause either the avatarOverlay renderer or the primary application route to enter an error boundary. The main Codex UI should remain usable with the Pet enabled.

Troubleshooting already performed

Before isolating the Pet trigger, I tried the following without fixing the problem:

  • Reinstalled the desktop app.
  • Temporarily disabled ~/.codex/config.toml.
  • Reset ~/Library/Application Support/com.openai.codex.
  • Retested startup after those resets.

The decisive workaround is disabling the Pet.

Additional information

There are existing reports for the same r is not a function / AppRoutes regression and a Windows report specifically involving avatarOverlay (#44739, #44743, #44720). This report adds a macOS reproduction where toggling the Pet cleanly controls whether the failure occurs.

No credentials, account identifiers, thread IDs, or full raw logs are included here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing startup with the Codex Pet enabled and compare the AppRoutes/avatarOverlay failures with related issues #44739, #44743, and #44720. Trace the Pet overlay and primary route error paths; done means the app starts and remains usable with the Pet enabled, without the “r is not a function” error boundary.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.