Skip to content

feat(telemetry): emit session_end for exec and surface on cli_start - #1197

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-9020-session-end-exec
Sep 29, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-9020-session-end-exec

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Exec runner emits one best-effort session_end per run from the settle path, mirroring the TUI exit reporter's status/exit_reason contract.
  • Pre-try setup failures (session dir/state/persist) and unconfigured exec each emit a failed session_end, so every cli_start with surface exec is paired with exactly one session_end.
  • Missing-prompt usage errors deliberately emit nothing: exit 2 with no run started is not a session, and counting it as failed would pollute failed counts.
  • cli_start allowlist passes surface; startup tags exec runs exec and interactive runs tui; held first-run activation defaults to tui with an explicit override.

Verification

  • bun run lint passes (oxfmt + oxlint, 0 warnings/errors)
  • bun run typecheck passes
  • bun run build passes (via pre-commit hook)
  • bun run check:projects-dir-guard passes
  • New tests/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 case
  • Related suites pass: telemetry files 78 pass, tests/unit/exec/ 35 pass, tests/unit/index.test.ts 6 pass
  • Full bun 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; missing ts-prune binary for the dead-exports guard end-to-end test, failing identically on clean main)

Fixes CL-9020

@linear-code

linear-code Bot commented Sep 28, 2026

Copy link
Copy Markdown

CL-9020

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.
@TheGreatAxios
TheGreatAxios merged commit 1ae1a3e into main Sep 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant