Skip to content

feat(telemetry): classify codex trust-grant fallbacks and attribute grant lane - #10001

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/codex-trust-grant-telemetry-detail
Jul 23, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/codex-trust-grant-telemetry-detail

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Why

Post-rollout analysis of the codex real-home change (#9501, first stable v1.4.149) showed codex_trust_grant working as a rollout signal but leaving the biggest cohort undiagnosable:

  • 44% of installs emitting the event are fallback-only, with fallback_reason exclusively error/retry-cached and zero unsupported — the enum can't distinguish "codex CLI not installed" (harmless: 97% of that cohort never starts a codex agent) from "codex broken/timing out" (the ~176 real codex users stuck on the legacy managed home).
  • The event has no lane attribution: native hosts grant for both the real-home install and the managed-home installer, so host_kind alone can't split the rollout signal from managed multi-account grants.
  • verify_failed doubled version-over-version (84 → 184 installs on 1.4.149 → 1.4.150) but all distinct verify failure modes collapse into one bucket.

What

All additions are closed enums — no raw error/user/path content reaches the wire (matches the schema's existing strict/enum-only design).

  • lane: 'real-home' | 'managed' (required) — which install surface asked for the grant. Threaded via the grant plan from all three call sites: real-home install → real-home; native managed-home installer and WSL mirror → managed.
  • error_class (on reason: 'error' fallbacks) — binary-missing | timeout | entry-failed | early-exit | rpc-failed | unexpected. Errors cross the grant-bridge envelope as message text (only timeout/unsupported keep their name), so classes match the bounded message shapes each layer produces.
  • verify_class (on verify_failed) — session-side classes (list-mismatch | post-grant-untrusted | post-grant-mismatch, carried as a structured reasonClass through the bridge JSON envelope instead of string-matching diagnostics) plus module-side classes (unexpected-key | duplicate-key | coverage).

The telemetry types, classifier, and injected tracker moved to a new codex-trust-grant-telemetry.ts (the grant module was at the max-lines boundary; no limit bumps).

Verification

  • typecheck (node + cli + web) green; new module added to the CLI project's explicit file list.
  • 140 tests green across the six affected suites, including new coverage: lane attribution on granted/fallback events (decoupled from host kind), error_class on the wire, session reasonClass passthrough, module verify classes, and classifier table tests (ENOENT-in-stderr-tail stays early-exit).
  • build:electron-vite green — plain-node grant-entry chunk unaffected (telemetry module is electron-free; tracker stays injected from main).
  • No new lint findings in changed files (repo lint has pre-existing unrelated warnings on main).

Follow-ups (not this PR)

  • codex_home_lane property on agent_started (agent_kind=codex) — usage-weighted routing truth; needs threading through pty launch prep.
  • Consider skipping the startup grant probe when the codex binary can't resolve: ~33k failed codex app-server spawn attempts/day fleet-wide on machines without codex.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@brennanb2025, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d296665d-b3d4-45a8-871b-6fc4540cfb86

📥 Commits

Reviewing files that changed from the base of the PR and between b0e3616 and 913200d.

📒 Files selected for processing (12)
  • config/tsconfig.cli.json
  • src/main/codex-accounts/wsl-codex-command.ts
  • src/main/codex/codex-app-server-client.test.ts
  • src/main/codex/codex-app-server-client.ts
  • src/main/codex/codex-hook-trust-grant.test.ts
  • src/main/codex/codex-hook-trust-grant.ts
  • src/main/codex/codex-real-home-hook-install.ts
  • src/main/codex/codex-trust-grant-telemetry.test.ts
  • src/main/codex/codex-trust-grant-telemetry.ts
  • src/main/codex/hook-service.ts
  • src/main/index.ts
  • src/shared/telemetry-events.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025
brennanb2025 merged commit 407d7af into main Jul 23, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…rant lane (stablyai#10001)

* feat(telemetry): classify codex trust-grant fallbacks and attribute grant lane

* fix(telemetry): tighten codex trust-grant classification
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