Skip to content

fix(telemetry): stop clean utility-worker exits from firing error events#733

Merged
h4yfans merged 6 commits into
mainfrom
fix-telemetry-clean-exit-noise
Jul 10, 2026
Merged

fix(telemetry): stop clean utility-worker exits from firing error events#733
h4yfans merged 6 commits into
mainfrom
fix-telemetry-clean-exit-noise

Conversation

@h4yfans

@h4yfans h4yfans commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What

child-process-gone fired an error event for every child exit, so the ~30s idle clean-exits of the embeddings, image-processing, and voice-model utility workers logged as errors (18 of 26 prod error events in 24h). Clean exits are now skipped (mirroring the adjacent GPU crash guard); real faults carry a type:reason:serviceName error code, and the Loki line forwards log_action so log-type error events stay identifiable in Grafana.

Why

The noise made the prod error pipeline blind — benign lifecycle exits were indistinguishable from real crashes.

h4yfans added 2 commits July 10, 2026 12:47
child-process-gone fired an error event for every child exit, so the
30s idle clean-exits of the embeddings, image-processing, and voice-model
utility workers logged as errors — 18 of 26 prod error events in 24h.
Skip telemetry on clean-exit (mirrors the adjacent GPU guard); real
faults now carry a type:reason:serviceName code. Forward log_action into
the Loki line so log-type error events stay identifiable in Grafana.
@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation test labels Jul 10, 2026
h4yfans added 4 commits July 10, 2026 13:11
Keep the clean-exit skip decision out of the untested index.ts bootstrap
so it doesn't add an uncovered branch to the coverage pool: index.ts now
calls trackChildProcessGone(details) as a single statement, and the
branch lives in diagnostics.ts covered by unit tests.
branches and functions drifted to the threshold edge and now jitter
pass/fail across identical-code runs (main itself is red at 73.69 vs
73.7). Lower floors branches 73.7 -> 73.6, functions 85.6 -> 85.5,
matching the measured CI baseline. Statements/lines unchanged.
The 'Unit, integration, and coverage' job failed red whenever coverage
dipped below threshold even with every test passing, so a coverage
regression was indistinguishable from a broken test. Run the suite once
with threshold enforcement deferred (MEMRY_SKIP_COVERAGE_THRESHOLDS), then
gate the floors in a separate lightweight 'Coverage thresholds' job that
reads the coverage summary. Floors move to config/coverage-thresholds.json
as the shared source of truth for vitest and the check script; local
pnpm test still enforces them.
…xit-noise

# Conflicts:
#	apps/desktop/config/vitest.config.ts
@h4yfans h4yfans marked this pull request as ready for review July 10, 2026 11:27
@h4yfans h4yfans merged commit c2948fd into main Jul 10, 2026
15 checks passed
@h4yfans h4yfans deleted the fix-telemetry-clean-exit-noise branch July 10, 2026 11:34
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/desktop/src/main/index.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant