Skip to content

Record anonymous setup progress and outcome events - #5412

Merged
brsbl merged 2 commits into
mainfrom
bb/anonymous-setup-tracking-main-thr_gt5eeahuym
Oct 13, 2026
Merged

brsbl merged 2 commits into
mainfrom
bb/anonymous-setup-tracking-main-thr_gt5eeahuym

Conversation

@brsbl

@brsbl brsbl commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Setup progress, agent readiness, sign-in results and rejected new-thread submissions were not observable in anonymous telemetry.

What changed

  • Record anonymous setup progress, readiness, sign-in outcomes and new-thread submission outcomes through the opt-out-controlled telemetry route.
  • Accept fixed enums, booleans and explicit unknown values, without identifying fields or free-text error details.
  • Expose useSetupComplete and the experimental SDK method, and update configuration documentation.
  • Describe collection by usage category in Settings and the privacy page, while retaining purpose, identifiers, system details and opt-out instructions.

Supersedes #5394. Independently based on main; no shared-component dependency.

How you verified

  • PR CI passed on 3bd09c3262585b764d77cca6761fc2328a21c3bd. Full CI also passed after retrying the Windows provider-replay job.
  • Scoped review has no P0/P1 findings; the subsequent copy-only change preserves the reviewed telemetry implementation.
  • Focused exact-head QA PASS: Chrome for Testing 154.0.8037.92, Settings and privacy, desktop and phone widths; real Safari 26.5.2, privacy.
  • Initial rendering, settled layout, hard reload and client navigation passed. Chrome reported no page or console errors during disclosure checks.
  • Exact-head telemetry delivery passed through the production-mode sender to an isolated local sink; the HogQL query parsed and ran.
Exact-head telemetry delivery QA

Chrome for Testing 154.0.8037.92 exercised the branch web app at 3bd09c3262585b764d77cca6761fc2328a21c3bd with fresh app data, telemetry enabled and the real production-mode server sender.

  • The sink received each action once: all four steps reached, Agent/Devices completed, Projects/Plugins skipped, and setup finished.
  • Readiness was observed from real installed agents. Checking again emitted no duplicate readiness event.
  • A real Codex sign-in command opened its sign-in guide; cancelling emitted one started and one cancelled outcome.
  • Temporarily disabling the selected provider before forwarding an unchanged submit request produced a real 409 provider_disabled; the draft remained intact.
  • Re-enabling the provider produced 201, one accepted outcome and a real Claude Code reply of “OK”. Each submission emitted one started outcome.
  • Captured payloads contained only the random install ID, standard system properties and the expected event fields; no identifying fields or free text.

The default 0.0.0-dev version intentionally disables the sender. This pass used 0.0.0-qa-onboarding-3bd09c3 and a transport-only preload redirecting the unchanged capture body to a loopback sink. That version is not excluded by the dashboard's exact dev-version filter, so no test events were sent to PostHog. Product source and event handlers were unchanged.

Growth analytics independently executed the reached/ready/signed-in/submitted HogQL query against PostHog with no errors or warnings. This establishes query/schema compatibility; new-event ingestion after release remains unverified. Completing a new provider authentication was outside this pass: the real attempt was cancelled, and submission used an already-ready provider.

Retained boundary checks and follow-up

The unchanged implementation retains earlier API checks accepting allowed enum/null values and rejecting unknown enums, identifying extra fields and free text. Earlier sign-in startup-failure coverage used fixtures and was not a delivery check. Known P2 follow-up: abandonment during pending sign-in startup may be counted as failed when terminal creation later rejects.

Fresh full-viewport screenshots compare merge base d34a3d219193d37bf4bb31b6b345dd113800c3f1 with exact head 3bd09c3262585b764d77cca6761fc2328a21c3bd, using the same isolated fixture, routes and scroll anchors. Desktop: 1440 × 900 CSS pixels; phone: 390 × 844; both at 2×.

Surface Before After
Usage-data setting / desktop Before: Usage-data setting / desktop After: Usage-data setting / desktop
Privacy policy / desktop Before: Privacy policy / desktop After: Privacy policy / desktop
Usage-data setting / phone Before: Usage-data setting / phone After: Usage-data setting / phone
Privacy policy / phone Before: Privacy policy / phone After: Privacy policy / phone

The user approved the simplified disclosure screenshots at 3bd09c3 via Growth. Merge approval remains separate.

BB-Thread-ID: thr_gt5eeahuym

BB-Thread: Onboarding

AGENT GENERATED

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T00:04:09.098892Z 65885da PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65885da2da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/api_to_audit.md

## `PluginBbSdk.system.experimental_recordTelemetryEvent`

`system.experimental_recordTelemetryEvent(event)` posts one anonymous product event to `POST /api/v1/system/telemetry/events`, which forwards it to the server's usage telemetry under the install's anonymous id and drops it when usage data sharing is off. The request schema is a strict allow-list of setup-guide events with fixed enum or boolean properties; anything else is rejected with 400. Core callers, all through `recordTelemetryEvent` in `apps/app/src/components/onboarding/onboarding-telemetry.ts`: the setup guide (`OnboardingFlow`). Stabilize after deciding whether third-party plugins may emit product events at all (and, if so, how events are namespaced per plugin and rate limited), then rename project-wide and remove this entry.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge List every core telemetry caller in the audit

The audit says the setup guide is the only core caller and describes the schema as setup-guide-only, but NewThreadComposer.tsx also calls the same helper for the newly allowed new_thread_submit event. Update this entry to document that behavior and caller so the required API audit is complete and future stabilization work does not overlook the composer path.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

Comment on lines +176 to +178
experimental_recordTelemetryEvent(
args: SystemRecordTelemetryEventArgs,
): Promise<SystemRecordTelemetryEventResult>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Register the new SDK method in the Plugin Guide

Adding experimental_recordTelemetryEvent makes it a public PluginBbSdk surface, but the bb-sdk apiSymbols inventory in plugins/plugin-api-docs/src/surfaces.ts does not include it. Add PluginBbSdk.system.experimental_recordTelemetryEvent there so the canonical Plugin Guide can discover and document the new method.

AGENTS.md reference: AGENTS.md:L30-L30

Useful? React with 👍 / 👎.

@brsbl
brsbl merged commit e9dafb6 into main Oct 13, 2026
135 of 136 checks passed
@brsbl
brsbl deleted the bb/anonymous-setup-tracking-main-thr_gt5eeahuym branch October 13, 2026 01:18
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