Skip to content

fix(agent): show why Maple could not start on macOS - #1501

Merged
AnthonyRonning merged 1 commit into
masterfrom
claude/startup-failure-diagnostics
Nov 7, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
claude/startup-failure-diagnostics

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Why

A Mac user on 0.0.18 wrote in with a "Maple could not start" window that said only "The Maple host has stopped. You can close Maple and try starting it again." and offered a Close button.

On macOS that screen has one source. native_quit::install refused to install at launch, the guarded startup window stopped the host, and finish_required_stop then replaced the original error with the stop status. The reason was written only to ~/Library/Application Support/maple-agent-prod/store-v1/logs/maple-agent.log, so support had nothing to go on. The hook has behaved this way since #1215, so 0.0.19 and current master do the same.

What changes

  • The startup window keeps the original error under Details once a status replaces it. It also shows the log path, with the home folder written as ~ (%USERPROFILE% on Windows), so the path pastes into Go to Folder and copied text does not carry the account name.
  • Copy details copies a short report: app name, version and source revision, OS version and build, the error, the status shown and the log path. The labels stay in English for support.
  • Show log file reveals the log file. It only appears when the file exists.
  • Hook errors now say which check failed and why:
    • a missing delegate;
    • a delegate of another class, naming that class and whether it is a subclass of GPUIApplicationDelegate;
    • an existing applicationShouldTerminate:, naming the class and library that provide it.
  • The startup log line names the OS, for example starting on macOS 26.1 (25B78), aarch64, from a new system_info module. StorePaths::log_file replaces the hard-coded file name.
  • The new labels are in English and Spanish, stamped with just translations-reviewed es. The window's text is now in the accessibility tree.

The checks themselves are unchanged. Loosening them waits until the user's report tells us which check failed on their Mac.

The provider lookup compares class_getInstanceMethod results rather than reading method lists. objc 0.2's instance_methods() builds a misaligned empty slice for a class with no methods of its own, which panics under debug checks.

Testing

  • just ci passed locally on macOS 27.2.
  • New tests:
    • the report after a completed stop, and its locale handling;
    • the report when no status is shown;
    • the home-relative log path;
    • the hook's inherited-method provider lookup;
    • a key-value-observed delegate, reported as NSKVONotifying_…, a subclass of….
  • Live, in a local debug bundle with a test-only library loaded through DYLD_INSERT_LIBRARIES:
    • With applicationShouldTerminate: added to NSResponder, the window shows "…already handles termination (from NSResponder in …/inject.dylib)…".
    • With a key-value observer on the app delegate, it shows "…delegate is NSKVONotifying_GPUIApplicationDelegate, a subclass of the reviewed GPUIApplicationDelegate". So key-value observing alone stops Maple from starting today, although the hook would still work.
    • Copy details wrote the report to the real clipboard and its label changed to Copied. Show log file opened Finder on the logs folder.
  • Not run: the Windows and Linux startup window, which is the same view with a taller window, and a signed Prod build.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

When the native quit hook could not install, the startup window stopped
the host and then replaced the error with "The Maple host has stopped",
so the reason was only in the log file. A user hit this on 0.0.18 and
support had nothing to go on.

Keep the original error under Details, show the log path with the home
folder as ~, and add Copy details (version, OS, error, status, log path)
and Show log file. Hook errors now name the delegate's actual class and
whether it is a subclass of GPUI's, or the class and library that
provide applicationShouldTerminate:. The startup log line names the OS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning merged commit 7233eb4 into master Nov 7, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the claude/startup-failure-diagnostics branch November 7, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant