feat(telemetry): emit session_end for exec and surface on cli_start - #1197
Merged
Merged
Conversation
Pre-try setup failures and unconfigured exec now emit a failed session_end so every cli_start(surface exec) is paired. Missing-prompt usage errors stay emission-free: exit 2 with no run is not a session.
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
session_endper run from the settle path, mirroring the TUI exit reporter's status/exit_reason contract.execeach emit a failedsession_end, so everycli_startwith surfaceexecis paired with exactly onesession_end.cli_startallowlist passessurface; startup tags exec runsexecand interactive runstui; held first-run activation defaults totuiwith an explicit override.Verification
bun run lintpasses (oxfmt + oxlint, 0 warnings/errors)bun run typecheckpassesbun run buildpasses (via pre-commit hook)bun run check:projects-dir-guardpassestests/unit/telemetry-session-end-exec.test.ts: 12 pass, covering the pre-try setup failure, unconfigured-exec, and success-path exactly-one cases plus the missing-prompt no-emit casetests/unit/exec/35 pass,tests/unit/index.test.ts6 passbun run test: 8597 pass, 2 fail — both environmental and unrelated (transient ENOSPC on a 99%-full disk for an onboarding write test, since re-passing in isolation; missingts-prunebinary for the dead-exports guard end-to-end test, failing identically on clean main)Fixes CL-9020