Repository navigation
Report client exceptions PostHog can process; never report an already-running daemon as a crash - #307
Merged
Merged
Conversation
…-running daemon as a crash
- Error reporting named no function for a frame without one (`at file:line:col`),
and PostHog's error tracking drops an exception any of whose frames lacks
`function` ("missing field `function`"): 31 client exceptions in 30 days never
reached Error Tracking, among them observation-batch dead-letter errors. Such
a frame is now named `?`, as PostHog's own stack parser names it.
- Starting a daemon while one already holds the lock threw a plain Error that
both the detached child and its parent reported as a fatal daemon_startup
crash (42 events in 15 minutes when several MCP shims started a daemon at
once). It is now DaemonAlreadyRunningError: the child tells the parent over the
startup handshake (`already-running`), says so plainly and exits non-zero
without a report; the background launcher prints the running PID and exits 0,
since a daemon serving the home is what was asked for. Any other startup
failure is still reported as a fatal crash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two client error-reporting defects found while reviewing PostHog errors (2026-10-03..07):
parseStackFramesleftfunctionundefined for frames likeat file:line:col; PostHog's error-tracking processor rejects such an event ($cymbal_errors: "missing field \function`") and it gets no issue. 31 client exceptions in 30 days were invisible this way, including today'sHTTP 409: dead-lettering batchobservation-upload errors. Such frames are now named?`, as PostHog's own stack parser names them.already_running, and both it and its parent reported a fataldaemon_startupcrash (42 events in 15 minutes when several MCP shims started a daemon at once). It is nowDaemonAlreadyRunningError: the child tells its parent over the startup handshake (already-running), says so plainly and exits non-zero without a report; the background launcher prints the running PID and exits 0. Any other startup failure is still reported as a fatal crash.Verification
mainand pass here:apps/observer/tests/error-reporting/sanitize.test.ts,apps/observer/tests/recovery-healing.test.ts("starting a daemon that already runs").pnpm lint,pnpm typecheck,check:boundaries,check:secretspass locally (Node 22).pnpm test: all pass except tests that need a local Deno (read-only-broker,local-executor-native-workflow) anduser-service-manager"enables an active matching service that was left disabled at login", which fails the same way on cleanmainin this environment.Migrations & Breaking Changes
already-runningmessage; both ends ship in the same entry file.Privacy
Frames carry the same sanitized fields as before; only the placeholder name
?is added. Nothing new is reported; one fatal report is removed.