You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quitting with a held ⌘Q can throw "Object has been destroyed" in the main process #33614
Quit the desktop app with a held ⌘Q (Confirm quit: Hold) and got this main-process error dialog on the way out:
Uncaught Exception:
TypeError: Object has been destroyed
at WebContents.<anonymous> (.../app.asar/apps/desktop/dist-electron/main.cjs:133177:11)
That line is the setIgnoreMenuShortcuts call in the before-input-event listener in apps/desktop/src/window/DesktopWindow.ts, added in #33518. It reads window.webContents with no isDestroyed() check, so a key-up that lands while the window is tearing down throws. The other handlers in that file already guard. An early return on window.isDestroyed() should fix it.
Seen once, not reproduced on demand, so probably timing-dependent. A test that destroys the window and then emits before-input-event should hit it every time.
Confirming from a second machine — same crash, slightly different repro.
Environment:
T3 Code Desktop 0.1.8-nightly.20261109.4433 (Nightly app) on macOS arm64 (darwin 27.2.0)
Desktop app against local server (server running, same build)
Confirm-quit path (⌘Q quit flow)
Repro:
Quit on macOS with 2x CMD Q (quick double-press, not held)
Main-process error dialog appears on the way out:
"A JavaScript error occurred in the main process — Uncaught Exception:
TypeError: Object has been destroyed
at WebContents. (.../app.asar/apps/desktop/dist-electron/main.cjs:133177:11)
at WebContents.emit (node:events:514:28)"
Evidence:
Extracted main.cjs from the installed .app and checked line 133177:
it's the unguarded window.webContents.setIgnoreMenuShortcuts(...)
inside the before-input-event listener — no window.isDestroyed() check,
unlike the adjacent notify / zoom-changed handlers.
Matches the diagnosis here exactly; second keypress landing during
teardown throws. So held-⌘Q isn't the only trigger — 2x ⌘Q hits the same race.
Julius has taken this over in #33620, so I am stopping the duplicate issue-watch job. Initial inspection at bbdc7dc confirmed the unguarded window.webContents access in before-input-event. The second reporter also describes quick double-press Command-Q. I made no code changes and ran no reproduction tests; macOS reproduction remains unverified by this job.
Still present on 0.1.9-nightly.20261110.4465 (desktop app, local server, macOS 27.2.0 arm64, Confirm quit: Hold). Same dialog on quit with ⌘Q: TypeError: Object has been destroyed at WebContents.<anonymous> (.../dist-electron/main.cjs:133215:11), the setIgnoreMenuShortcuts call in the before-input-event listener. The fix in #33620 is not in this build yet.
Posted by Claude Opus 5.5 (Claude Code) from a T3 triage session.
Still present on 0.1.9-nightly.20261110.4478 (20c3dd3), the latest nightly: desktop app on macOS 27.2.0 arm64, quit with a quick double ⌘Q (not held). Same dialog: TypeError: Object has been destroyed at WebContents.<anonymous> (.../dist-electron/main.cjs:133250:11), which is the setIgnoreMenuShortcuts call in the before-input-event listener (DesktopWindow.ts:709 at that tag). The desktop trace shows the desktop.lifecycle.beforeQuit span completing normally around the dialog, so shutdown still finishes. #33620 is not in this build.
Posted by Claude Opus 5.5 (Claude Code) from a T3 triage session.
Additional report from a macOS arm64 installation: installed T3 Code (Beta) desktop and local server are both 0.1.8; the screenshot-time version was not independently verified.
The user was using a Codex thread when the whole Mac appeared unresponsive. They tried various keys; responsiveness eventually returned with this main-process dialog:
TypeError: Object has been destroyed
at WebContents.<anonymous> (.../main.cjs:133177:11)
at WebContents.emit (node:events:514:28)
No specific shortcut, held Cmd+Q, or deliberate quit sequence is confirmed. There is no deterministic reproduction.
In the currently installed ASAR, line 133177 calls quitShortcutHandler(event, input); line 133178 calls setIgnoreMenuShortcuts. Both are in the before-input-event callback, which lacks a destroyed-window guard after the quit handler.
A separate server trace shows a 21.8-second SQLite COMMIT and a nearby 21.1-second event-loop delay, reported in #30065. Exact incident timing remains unconfirmed. The destroyed-object error may be secondary to attempts to recover from the freeze; it is not established as the cause of the initial unresponsiveness. No local patch was applied.
A fast double tap of ⌘Q seems to hit this more reliably than a hold. Seen on 0.1.9-nightly.20261110.4478, macOS, where it throws at main.cjs:133250:11. That is the same setIgnoreMenuShortcuts line in the before-input-event listener.
Why the double tap hits it: a second press within QUIT_DOUBLE_PRESS_MS calls quitNow() synchronously inside quitShortcutHandler(event, input), so the window is already destroyed when the listener reads window.webContents on the next line. No timer or trailing key-up is involved, so it doesn't depend on hold timing.
#33620's guard after quitShortcutHandler covers this path too.
Confirmation from another user (reported via their T3 Code session; posting on their behalf):
T3 Code (Beta) 0.1.8 stable desktop app on macOS arm64 (Darwin 24.5.0 / macOS 15.5), quit with a single plain ⌘Q — not held, not double-pressed.
Same main-process dialog on quit:
Uncaught Exception:
TypeError: Object has been destroyed
at WebContents.<anonymous> (.../app.asar/apps/desktop/dist-electron/main.cjs:133177:11)
at WebContents.emit (node:events:514:28)
I extracted the installed app's ASAR and confirmed line 133177 is the unguarded window.webContents.setIgnoreMenuShortcuts(...) call in the before-input-event listener, matching the original diagnosis — so even a single ⌘Q can land a trailing input event during teardown, not just held/double presses.
Note this is 0.1.8 stable, so #33620 (merged 2026-11-10) hasn't reached this user yet; flagging that stable-channel users are still hitting it until 0.1.9 ships.
Activity
philippdormann commentedon Nov 10, 2026
Confirming from a second machine — same crash, slightly different repro.
Environment:
Repro:
"A JavaScript error occurred in the main process — Uncaught Exception:
TypeError: Object has been destroyed
at WebContents. (.../app.asar/apps/desktop/dist-electron/main.cjs:133177:11)
at WebContents.emit (node:events:514:28)"
Evidence:
main.cjsfrom the installed.appand checked line 133177:it's the unguarded
window.webContents.setIgnoreMenuShortcuts(...)inside the
before-input-eventlistener — nowindow.isDestroyed()check,unlike the adjacent
notify/zoom-changedhandlers.teardown throws. So held-⌘Q isn't the only trigger — 2x ⌘Q hits the same race.
shivamhwp commentedon Nov 10, 2026
Julius has taken this over in #33620, so I am stopping the duplicate issue-watch job. Initial inspection at bbdc7dc confirmed the unguarded window.webContents access in before-input-event. The second reporter also describes quick double-press Command-Q. I made no code changes and ran no reproduction tests; macOS reproduction remains unverified by this job.
vramana commentedon Nov 10, 2026
Still present on 0.1.9-nightly.20261110.4465 (desktop app, local server, macOS 27.2.0 arm64, Confirm quit: Hold). Same dialog on quit with ⌘Q:
TypeError: Object has been destroyed at WebContents.<anonymous> (.../dist-electron/main.cjs:133215:11), thesetIgnoreMenuShortcutscall in thebefore-input-eventlistener. The fix in #33620 is not in this build yet.Posted by Claude Opus 5.5 (Claude Code) from a T3 triage session.
BrendanH18 commentedon Nov 10, 2026
Still present on 0.1.9-nightly.20261110.4478 (20c3dd3), the latest nightly: desktop app on macOS 27.2.0 arm64, quit with a quick double ⌘Q (not held). Same dialog:
TypeError: Object has been destroyed at WebContents.<anonymous> (.../dist-electron/main.cjs:133250:11), which is thesetIgnoreMenuShortcutscall in thebefore-input-eventlistener (DesktopWindow.ts:709at that tag). The desktop trace shows thedesktop.lifecycle.beforeQuitspan completing normally around the dialog, so shutdown still finishes. #33620 is not in this build.Posted by Claude Opus 5.5 (Claude Code) from a T3 triage session.
softmaxe commentedon Nov 10, 2026
Additional report from a macOS arm64 installation: installed T3 Code (Beta) desktop and local server are both 0.1.8; the screenshot-time version was not independently verified.
The user was using a Codex thread when the whole Mac appeared unresponsive. They tried various keys; responsiveness eventually returned with this main-process dialog:
No specific shortcut, held Cmd+Q, or deliberate quit sequence is confirmed. There is no deterministic reproduction.
In the currently installed ASAR, line 133177 calls quitShortcutHandler(event, input); line 133178 calls setIgnoreMenuShortcuts. Both are in the before-input-event callback, which lacks a destroyed-window guard after the quit handler.
A separate server trace shows a 21.8-second SQLite COMMIT and a nearby 21.1-second event-loop delay, reported in #30065. Exact incident timing remains unconfirmed. The destroyed-object error may be secondary to attempts to recover from the freeze; it is not established as the cause of the initial unresponsiveness. No local patch was applied.
Investigated by Codex (GPT-6) via t3 triage.
ishaanko commentedon Nov 10, 2026
Note
Written by
claude-opus-5-5on behalf of IshaanA fast double tap of ⌘Q seems to hit this more reliably than a hold. Seen on
0.1.9-nightly.20261110.4478, macOS, where it throws atmain.cjs:133250:11. That is the samesetIgnoreMenuShortcutsline in thebefore-input-eventlistener.Why the double tap hits it: a second press within
QUIT_DOUBLE_PRESS_MScallsquitNow()synchronously insidequitShortcutHandler(event, input), so the window is already destroyed when the listener readswindow.webContentson the next line. No timer or trailing key-up is involved, so it doesn't depend on hold timing.#33620's guard after
quitShortcutHandlercovers this path too.bignosecss commentedon Nov 11, 2026
Confirmation from another user (reported via their T3 Code session; posting on their behalf):
I extracted the installed app's ASAR and confirmed line 133177 is the unguarded
window.webContents.setIgnoreMenuShortcuts(...)call in thebefore-input-eventlistener, matching the original diagnosis — so even a single ⌘Q can land a trailing input event during teardown, not just held/double presses.Note this is 0.1.8 stable, so #33620 (merged 2026-11-10) hasn't reached this user yet; flagging that stable-channel users are still hitting it until 0.1.9 ships.