Skip to content

macOS: silent tray/core exits are unattributable — add shutdown-reason logging + lifecycle diagnostics (was: phantom v0.50.0 self-relaunch report) #862

Description

@algis-dumbris

Summary

On v0.50.0 (Personal, macOS DMG install), the whole app — tray and core — silently exited and self-relaunched in the middle of an active working session, ~25h after install. There was no user action, no macOS sleep/reboot at that moment, no crash report, no version change, and no shutdown reason logged. The ~60s outage dropped 3 active MCP sessions; a connected streamable-HTTP client (Claude Code) marked the server disconnected and required a manual reconnect to recover.

Previous versions I ran (v0.41 → v0.48) never restarted spontaneously — every Starting mcpproxy line in my logs before v0.50.0 corresponds to a manual upgrade/restart (v0.48.0 ran Jul 9–13 continuously, surviving multiple macOS sleep cycles). This looks like a lifecycle regression in v0.50.0, possibly around the new "Start Core when the app opens" feature (#847, #410).

Timeline (local time, +03:00)

  • Jul 14 12:16 — v0.50.0 installed and started (DMG). Runs normally for ~25h.
  • Jul 15 12:59:06 — last log line from the old core (routine Doctor diagnostics completed, running on its normal ~31s cadence all morning — machine awake, client session active).
  • Jul 15 12:59:06 → 13:00:04 — process dies silently: no shutdown/exit lines in main.log, no crash report in ~/Library/Logs/DiagnosticReports, no reboot (uptime since Jun 15), binary mtime unchanged (no update applied).
  • Jul 15 13:00:04 — tray (ppid 1) and core both start fresh: Starting mcpproxy {"version": "v0.50.0"}Closed stale sessions on startup {"count": 3}. ~/.mcpproxy/tray-autostart.json is rewritten the same second ("updated_at":"2026-07-15T10:00:04Z"), so something orchestrated a relaunch — but nothing logged why.
  • Connected MCP client (Claude Code, streamable HTTP on 127.0.0.1:8080/mcp) hit the outage, flagged the server disconnected, and stayed broken until a manual /mcp reconnect.

Log excerpts

Old instance, last minute (normal operation, then nothing):

2026-07-15T12:59:06.124+03:00 | INFO | httpapi/server.go:3302 | Doctor diagnostics completed | {"total_issues": 0, ...}
2026-07-15T13:00:04.843+03:00 | INFO | cobra@v1.10.2/command.go:1015 | Log directory configured | ...
2026-07-15T13:00:04.844+03:00 | INFO | cobra@v1.10.2/command.go:1015 | Starting mcpproxy | {"version": "v0.50.0", "edition": "personal", ...}
2026-07-15T13:00:04.893+03:00 | INFO | bbolt@v1.5.0/db.go:922 | Closed stale sessions on startup | {"count": 3}

Both PIDs date from the relaunch:

  PID STARTED                       PPID COMMAND
50340 Wed Jul 15 13:00:04 2026         1 /Applications/mcpproxy.app/Contents/MacOS/MCPProxy
50344 Wed Jul 15 13:00:04 2026     50340 .../Resources/bin/mcpproxy serve

What I ruled out

  • macOS sleep/wake: doctor diagnostics ran on cadence right up to 12:59 — machine awake. (v0.48 also survived sleep fine for days.)
  • Crash: no DiagnosticReports entry (a SIGSEGV/panic would leave one; a silent orchestrated exit + relaunch wouldn't).
  • Auto-update applied: version identical before/after; app bundle mtime unchanged (Jul 14); v0.51.0-rc.1 was published ~3h after the restart.
  • User action / reboot / login: none.

Asks

  1. Investigate what in v0.50.0 can exit+relaunch the app outside user action (tray watchdog? update-checker path? the new start-core-on-open logic from feat(tray): add "Start Core when the app opens" preference (#410) #847?).
  2. Log the shutdown reason. A graceful, self-initiated restart should say who requested it and why; currently the log just stops.
  3. The update checker logs nothing about its periodic checks at INFO — with that, this report could have confirmed/excluded the updater in seconds.
  4. Consider draining/preserving client sessions across an intentional self-restart, or at least making the outage short enough that streamable-HTTP clients survive it (Claude Code gives up permanently after a failed request and needs manual reconnection).

Environment

  • mcpproxy v0.50.0 (personal), DMG install, macOS Darwin 25.5.0 (arm64)
  • 4 upstream servers (stdio/docker mix), client: Claude Code via streamable HTTP + API key
  • Happy to provide fuller logs privately if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions