Repository navigation
Description
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.jsonis 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/mcpreconnect.
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 | [email protected]/command.go:1015 | Log directory configured | ...
2026-07-15T13:00:04.844+03:00 | INFO | [email protected]/command.go:1015 | Starting mcpproxy | {"version": "v0.50.0", "edition": "personal", ...}
2026-07-15T13:00:04.893+03:00 | INFO | [email protected]/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
- 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?).
- Log the shutdown reason. A graceful, self-initiated restart should say who requested it and why; currently the log just stops.
- The update checker logs nothing about its periodic checks at INFO — with that, this report could have confirmed/excluded the updater in seconds.
- 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.
Activity
Dumbris commentedon Jul 16, 2026
Investigation update — local forensics + v0.50.0 code review
A two-track investigation (macOS forensics on the reporting machine; full lifecycle code review of the v0.50.0 sources) could not ground this issue's evidence, and the code review answers ask #1 independently. Correcting the record so nobody chases a phantom regression:
Forensics — the quoted evidence does not match the reporting machine:
Info.plist+mcpproxy --version); no v0.50.0 binary, DMG, or download artifact exists on that machine. The only "v0.50.0" string in any log is an update-checker "update available" notice.main.loglines exist in no on-disk log file, andStarting mcpproxy v0.50.0doesn't match the real log format (the version is always a structured JSON field, never inline).main.log: APFS birth Jul 14 22:29, mtime Jul 14 23:19 — created Jul 14, untouched since, no Jul-15 rotation; it ends with an orderly shutdown (Docker teardown), and no production core ran after that.tray-autostart.jsonactually readsupdated_at: 2026-07-13T18:29:25Z, not2026-07-15T10:00:04Z.Code review (v0.49.0→v0.50.0 delta): there is no code path in the v0.50.0 tray (Swift or Go) or core that self-terminates and relaunches the app. The lifecycle delta is entirely #410 (start-core-on-open); Sparkle is linked but never instantiated (update checks are notify-only, hourly tray / 4h core); no watchdog, no health-give-up kill, no single-instance takeover. A silent stop with zero shutdown log lines would imply SIGKILL-class termination from outside the app (e.g. jetsam — the core tree can reach ~1.8GB RSS), since graceful paths do log.
Worth keeping from this issue (asks 2–4 are real diagnosability gaps):
os_logat Default level for tray/core lifecycle events, so the macOS unified log retains spawn/exit context past the Info-tier purge.Mcp-Session-Idresume).Unless the incident reproduces on a machine actually running v0.50.0, suggest re-scoping this issue to the diagnosability improvements above.
[-]v0.50.0 (macOS): tray+core silently exit and self-relaunch mid-session; no shutdown log or crash report; HTTP MCP clients need manual reconnect[/-][+]macOS: silent tray/core exits are unattributable — add shutdown-reason logging + lifecycle diagnostics (was: phantom v0.50.0 self-relaunch report)[/+]Dumbris commentedon Jul 22, 2026
Re-scope: regression claim closed, issue retitled to the diagnosability work
Why the v0.50.0 regression claim is closed
The forensic follow-up above (2026-07-16, "Investigation update — local forensics + v0.50.0 code review") overturned the original report on both tracks:
Info.plist+mcpproxy --version); no v0.50.0 binary, DMG, or download artifact was found there. The quotedmain.logexcerpts exist in no on-disk log, andStarting mcpproxy v0.50.0doesn't even match the real log format (version is always a structured JSON field, never inline). The realmain.log(APFS birth Jul 14 22:29, mtime Jul 14 23:19) ends with an orderly shutdown,tray-autostart.jsonreadsupdated_at: 2026-07-13T18:29:25Z(not Jul 15), and the unified log shows no launchd/cron/agent activity, sleep/wake, or crash report in the 12:55–13:02 window.So there is no phantom v0.50.0 regression to chase. What is real — and what the investigation itself flagged — is that if a silent SIGKILL-class exit ever happens (e.g. jetsam; the core tree can reach ~1.8 GB RSS), today's logging leaves it completely unattributable: graceful paths log, but nothing records who/why on lifecycle transitions, and macOS purges the Info/Debug unified-log tier before anyone looks.
Re-scoped deliverables (from the investigation comment)
os_logat Default level for tray/core lifecycle events — so the macOS unified log retains spawn/exit context past the Info-tier purge.Streamable-HTTP session resilience across restarts (original ask #4 / investigation item 5) deserves its own small spec (faster listener handoff vs
Mcp-Session-Idresume) and is best tracked separately rather than bundled here.Acceptance note
The original regression claim (spontaneous self-exit + self-relaunch) reopens only if the incident is reproduced on a machine genuinely running v0.50.0 — verified via
Info.plist/mcpproxy --version— with logs pulled directly from disk. Until then, this issue tracks the diagnosability checklist above.fix(tray): stop reporting clean shutdowns as crashes, and keep signal…
fix(tray): glance clause/header consistency, saturated-core guard, in…
Dumbris commentedon Aug 1, 2026
Addressed in #945 (merged as
b30407fea).Shutdown-reason logging and lifecycle diagnostics are now emitted, so the next occurrence of a silent tray/core exit is attributable rather than a mystery. Sample from a QA run (a core that failed to start):
Termination reason, initiator and uptime are recorded on the lifecycle paths.
This does not retroactively explain the original v0.50.0 event — nothing can — but it converts the next one from unattributable into diagnosable, which is what the issue asked for. Left open per the repo's manual-closure convention; worth keeping open until a real-world silent exit is captured with the new journal.
Dumbris commentedon Aug 2, 2026
Shipped in v0.53.0-rc.4 (published 2026-08-01). Shutdown-reason logging and lifecycle diagnostics are now emitted (
lifecycle coreTerminated: <reason> (uptime Ns)), so the next silent exit is diagnosable rather than a mystery. Note this cannot retroactively explain the original v0.50.0 event — if another unexplained exit happens, reopen with the new journal lines attached and they should identify it.Closing now that the fix is in a testable build. Reopen if it does not behave as described on a real install.