Skip to content

[codex] Add agent funnel telemetry - #262

Merged
samuelstroschein merged 1 commit into
mainfrom
codex/agent-prompt-telemetry
Jul 2, 2026
Merged

[codex] Add agent funnel telemetry#262
samuelstroschein merged 1 commit into
mainfrom
codex/agent-prompt-telemetry

Conversation

@samuelstroschein

@samuelstroschein samuelstroschein commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Add typed agent_start_failed and prompt_submitted telemetry events.
  • Emit agent_start_failed for handled agent version startup failures and unexpected terminal startup failures, including initial command write failures.
  • Emit prompt_submitted from agent turn-start hooks with safe funnel properties: agent, surface, source, and attempt_number.

Why

The onboarding funnel had a blind spot between agent_opened and diff_opened, making it impossible to distinguish users who never submitted a prompt from users whose submitted prompt produced no visible diff. Agent startup failures also rendered an error card without structured telemetry.

Validation

  • pnpm vitest run src/extensions/terminal/index.test.tsx src/lib/telemetry.test.ts electron/telemetry.test.mjs
  • pnpm vitest run src/shell/layout-shell.test.tsx -t "prompt submitted"
  • pnpm prettier --check electron/types.d.ts src/shell/layout-shell.tsx src/shell/layout-shell.test.tsx src/extensions/terminal/index.tsx src/extensions/terminal/index.test.tsx

Known issue

  • pnpm run typecheck still fails on existing unrelated Lix SDK type drift around missing ExecuteOptions exports in src/lib/lix-types.ts and src/test-utils/node-lix-sdk.ts.

Note

Low Risk
Observability-only changes with no changes to auth, persistence, or agent execution behavior beyond firing telemetry on existing error paths and hook handlers.

Overview
Adds typed agent_start_failed and prompt_submitted desktop telemetry events to close gaps between agent_opened and diff_opened.

Terminal startup: TerminalView now emits agent_start_failed when agent terminals fail to start—version check outcomes (missing, unsupported, timeout, etc.), unexpected PTY/create errors, and initial command write failures. Payloads include agent, reason, surface: terminal, retry_count, and version fields when applicable; unexpected failures also call captureTelemetryException.

Prompt funnel: On agent turn-start hooks, the layout shell records prompt_submitted with agent, surface: terminal, source: agent_hook, and a per-session attempt_number keyed by instance, agent, and session.

Tests mock telemetry in terminal and layout-shell suites to assert event names and properties.

Reviewed by Cursor Bugbot for commit 7f3e030. Bugbot is set up for automated code reviews on this repo. Configure here.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
flashtype-website 7f3e030 Commit Preview URL

Branch Preview URL
Jul 02 2026, 10:26 PM

@samuelstroschein
samuelstroschein merged commit 46c0c0b into main Jul 2, 2026
5 checks passed
@samuelstroschein
samuelstroschein deleted the codex/agent-prompt-telemetry branch July 2, 2026 23:42
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