Skip to content

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

Open

Description

@SergeyPy

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.

Activity

  1. added
    bug
    app
    on Sep 11, 2026
  2. dpolivaev commented on Sep 11, 2026

    @dpolivaev

    How can one disable pets if the app is not even starting?
    Which genius believes I need pets?
    I hate pets
    I love LLMs

  3. Andrewlawn commented on Sep 11, 2026

    @Andrewlawn

    Same crash signature reproduced on macOS (Apple M5, app 26.908.31748): avatarOverlay AppRoutes error boundary with r is not a function, and the same decisive workaround — setting electron-avatar-overlay-open: false in ~/.codex/.codex-global-state.json and relaunching restores a clean single-window app.

    Details posted in #44743 (comment thread): #44743 (comment)

    Two extra data points from my logs that fit this Pet isolation report:

    • The overlay crashed even when the local app-server was healthy (models refresh succeeded), so the failure is in the overlay render path itself, not downstream of the models fetch.
    • The stuck error-state window had no reachable AXCloseButton and ignored Cmd+W; it was restored offscreen (x=1084, y=-218, 772×1867) until the persisted electron-avatar-overlay-open flag was cleared.
  4. changgunyee commented on Sep 11, 2026

    @changgunyee

    Also affected on macOS with ChatGPT/Codex desktop version 26.908.40401. The main window remains usable, but a secondary side window displays the generic error screen. Retrying, updating, and restarting have all failed to resolve it.

    Local logs repeatedly show errorMessage="r is not a function", name=AppRoutes, and rendererWindowAppearance=avatarOverlay (2026-09-11 at 16:40 UTC).

    This confirms the same crash signature on 26.908.40401. The Pet-disabling workaround has not yet been tested on this machine.

  5. KX76 commented on Sep 13, 2026

    @KX76

    Also observed on macOS with ChatGPT/Codex Desktop 26.908.31748 (bundle identifier com.openai.codex).

    Additional impact: the failed Pet overlay becomes a large opaque black area on the right side of the desktop, displaying “ChatGPT hit a snag”. It remains visible even after the main application window is minimized, obstructing the desktop.

    Local investigation identified the failure in the independent avatarOverlay window (windowId=2), while the main window is primary (windowId=1). The AppRoutes error boundary reports r is not a function, with Lazy / Suspense at the top of the component stack. The same error recurred several times in the overlay.

    The installed application's window configuration sets avatarOverlay to always-on-top, non-minimizable, and visible on all workspaces. The generic recovery component uses a full-window recovery background. This appears to explain why a failed overlay remains as an opaque desktop obstruction after minimizing the main window.

    The persisted electron-avatar-overlay-open setting was true and has been changed to false. Post-relaunch recovery has not yet been independently verified in this report.

    Network-disconnection and timeout errors were also present, but no causal link to the JavaScript exception has been established. The available exception stack does not identify the original function represented by r.

    Expected: a failed optional Pet overlay should be dismissible and should not leave an opaque always-on-top recovery page covering the desktop. Disabling the Pet should persist across launches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugpets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions