Skip to content

Send OpenBot for Business opened and booked from the app, with one event ID per person, organization, place, surface and UTC day - #2927

Open
ACl365 wants to merge 28 commits into
mainfrom
alex/2026-12-03/business-once-a-day
Open

ACl365 wants to merge 28 commits into
mainfrom
alex/2026-12-03/business-once-a-day

Conversation

@ACl365

@ACl365 ACl365 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Nobody could tell how many people opened OpenBot for Business from the app, or from where, against the calls booked there. Every entry opens the same dialog, and since 1.2.1 its calendar has tagged a booking with the entry it was opened from (utm_content). But nothing counted the opening, and the dialog's booked handler did nothing. Only Desktop's setup window counted its own booker.

Why. openTeamFeatures(from) in team-features-dialog.tsx opened the dialog without a count. BookDemo's booked callback was a no-op, and onboarding's Book a demo step (useBookDemoStep in routes/_authed/onboarding.tsx) had no count for its opening or its booking.

The fix. A new operation, recordBusinessEvent (POST /api/v2/organizations/{organizationId}/business-events), sits beside the nudges' with the same security and the same answer (204, no body). Its body is strict and closed:

{"action":"opened","place":"account_menu","surface":"web"}
  • action: opened | booked.
  • place: account_menu, home, admin, computer_line, self_host_banner or onboarding. That is every AppBusinessPlace in shared/openbot-for-business.ts except sign_in, where nobody is signed in.
  • surface: web, or desktop for OpenBot Desktop's main window (the same desktopShell() test the other counts use).

In the app:

  • Opened is counted in openTeamFeatures(from) when the entry is pressed, once for each opening, never when the dialog draws. Reaching an entry while the dialog is already open changes nothing: the place stays the first entry's, so the opening, the calendar's utm_content and a booking all name the same entry. Closing the dialog and opening it again is a new opening. On onboarding's step, the opening is Book a demo being pressed (see Decisions, 2).
  • Booked is counted in the dialog's booked handler and in onboarding's step. BookingCalendar calls both only for calendly.event_scheduled from Calendly's origin and the calendar's own frame, the check that was already there. Nothing else in Calendly's message is read.
  • Best effort, like a nudge: keepalive, no retry, a fresh Idempotency-Key, and the UI never waits for it. A refusal, a 404, a 5xx or no answer is a console warning, with nothing on screen.
  • Nothing is sent from OpenBot Cloud's sign-in screen (sign_in), which is signed out. Its bookings keep their utm_content tag and nothing else.
  • Switching organization closes the dialog before the new organization is drawn (onOrganizationChange). Before this, the layout rebuilt for the new organization drew the dialog open again for a moment, with a calendar of its own. With counts, a booking made there would have been counted in the new organization. This is the only visible change.
  • BusinessAction is the generated BusinessEvent["action"], so the spec and the app name the same actions.

The server's half (see Merge order) sends oss.runtime.openbot.business_opened or business_booked with business_place and business_surface, under the signed-in person's user_id pseudonym, for every accepted request. The event ID is the lowercase hex SHA-256 of <deployment_id>:business:<user_id>:<organization id>:<action>:<place>:<surface>:<YYYY-MM-DD>:

  • The organization is the one the address resolves to, so naming it by slug or by id gives the same ID. A personal server's organization is default.
  • The day and occurred_at come from one reading of the server's clock.
  • The ID repeats on a repeat that day, and each repeat is still sent. So:
    • distinct event_id counts person-days;
    • distinct deployment_id + user_id counts people;
    • Calendly's record stays the count of bookings, and business_booked carries no reference to a booking.
  • The organization is not a property. The ID is pseudonymous, not secret, though: every other part of it is in the event. Anyone with a list of candidate organization ids, such as the org_id on OpenBot Cloud's run events, can find the organization by hashing each one.

On and off. There is no new setting: these follow product telemetry's existing switch, as nudges do.

  • They are on in OpenBot Desktop's own server while Share usage data is on (the default) and on OpenBot Cloud by default. Any other server sends them only with OPENBOT_PRODUCT_TELEMETRY=1.
  • OPENBOT_PRODUCT_TELEMETRY=0, DO_NOT_TRACK or COPILOTKIT_TELEMETRY_DISABLED turns them off.
  • While Share usage data is off, Desktop starts its server with COPILOTKIT_TELEMETRY_DISABLED=1 (fresh_runtime_env). The server's tests inject that environment; it was not run through a real Desktop restart.
  • Where telemetry is off, the server still answers 204 and drops the event. The app sends the same request either way.

Desktop's setup-window events (oss.desktop.business_opened and business_booked, for welcome and move_to_cloud) are unchanged.

Decisions for you. Both need your answer before merge. The first can't be undone after a release.

  1. Who may record it. It takes the same credentials as recordNudgeEvent: the web session, an app's access token with conversations:write, or an API key. The alternative is webSession only, since only the app's screens send it. Narrowing it after a release would tighten a released operation, which the 12-month rule forbids. If you pick webSession only, three things change: one security line in api/openapi/conversations.yaml, bun run api:generate here and in the server, and the server's API-key and app-token caller tests, which become refusals.
  2. Onboarding's opening. It is counted when Book a demo is pressed, because every local evaluator sees the step without asking for it. Counting the step as it comes on screen would make onboarding's openings step views, while every other place counts a press. Desktop's setup window counts its page coming on screen. If you prefer that, the change is a guarded effect on the step, with tests for StrictMode, Back and Continue. Otherwise nothing changes.

Where it runs

  • New state that outlives a request? One api_idempotency_keys row per count, kept 24 hours, the same as every write and the same as a nudge event, with telemetry on or off. Nothing else: the dialog's open flag was already page state, and nothing is stored to make the daily ID, which is a hash.
  • What happens on the second replica? Any replica answers. Replicas give the same ID as long as they share deployment_id and KEY_ENCRYPTION_KEY, and Query G counts distinct event_id. Each replica reads the day from its own clock, so two clocks that disagree across midnight UTC can put one person's repeats in two days.
  • Anything serialised? No.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No: one new operation on the existing API.

Boundary and audit

  • Every acting call still goes through the gateway. A count is product telemetry, not an action, like the nudges' count.
  • New refusals and new failures each write a row? No row, as for nudges. A refusal is a problem answer (the nudges' 400, 401, 403, 404, 409, 413, 429), and a count is telemetry, not an action.
  • Nothing new is trusted from the client that the server can resolve itself. The person and the organization come from the session, and the day from the server's clock. Only the place and the surface come from the client, as closed enums.

API and database

  • This changes api/ and the web app's requests, and keeps every rule in docs/api-and-migrations.md: one new operation, and nothing removed, renamed, retyped or tightened. There is no database change and no release-policy.json change. This box gets ticked once CI's box below is.

  • I read this page.

  • Nothing a released app uses is removed, renamed, retyped or tightened in place.

  • n/a: New request inputs are optional; a response enum that will grow is x-extensible-enum. This is a new operation whose three fields are required from the start. The request enums are enum, as a client sends them, and the 204 has no body.

  • n/a: Anything replaced is deprecated with an x-sunset. Nothing is replaced.

  • Nothing new in api/accepted-breaking-changes.md. The file is unchanged.

  • bun run api:generate run, with sources, bundle and clients committed together. At the head it changes nothing, and bun run api:lint is valid.

  • n/a: database changes; release-policy.json.

  • CI's API spec job is green on the exact head. It hasn't run yet; see CI below.

Changelog

Telemetry.

  • Your OpenBot now reports where people open OpenBot for Business and book a call. With product telemetry on, opening it from the app, pressing Book a demo on onboarding's OpenBot for Business step, or booking a call in its calendar sends oss.runtime.openbot.business_opened or business_booked, with the place and web or desktop.
  • It never sends the time booked, anything typed into the calendar, or the organization, and it is off wherever product telemetry is off (docs/TELEMETRY.md).

API.

  • Added: POST /api/v2/organizations/{organizationId}/business-events (recordBusinessEvent). Records that the caller opened OpenBot for Business or booked a call in it, and from which screen. It is best effort, and is accepted and dropped where product telemetry is off.

Proof

Local, on Bun 1.4.3, as CI runs. Head: 39a310e8b (4 Dec). It is 43275e27c plus one docs sentence (the pseudonymous-not-secret line above).

main (ab684e590) was then merged in as 8cd96a35a, since it had changed api/openapi.yaml and the generated client too. At 8cd96a35a (Bun 1.3.14): bun run api:generate changed nothing; typecheck, lint, format:check and api:lint are clean; 72 test files (every test that touches the API spec or the generated clients, the onboarding tests and this branch's own) gave 484 pass, 197 skip, 0 fail; bun run build in app/ passed. The runs below are from before that merge.

Tests across each boundary

  • Window to server, against the spec. app/tests/business-events.test.tsx answers every request with the handler generated from api/openapi.yaml (getRecordBusinessEventMockHandler). It holds every body to RecordBusinessEventBody.strict() and the key to RecordBusinessEventHeader, and any other request fails the test. The onboarding tests match by the generated URL builder. No URL or body is written by hand.
  • Calendly to the window. The tests use real MessageEvents from Calendly's origin and the frame's contentWindow, and also from a wrong origin, the page itself and another frame. The booking tests carry what Calendly sends (the event and the invitee, synthetic) and hold each body to exactly action, place and surface.
  • Server to sink is the server's half: refusals, the ID's six parts, one clock reading, the opt-outs, and no organization id or slug in any event.

Routes

Every way to reach the dialog, its calendar or onboarding's calendar. I found them by grepping every caller of openTeamFeatures, TeamFeaturesDialog, BookingCalendar, NavigationTarget, navigationRender, BusinessComputerLink, BusinessLink, ForATeam, SelfHostBanner and the Calendly host across app/, desktop/ and shared/. I swept again at the head. The files that name them are the same 44 as at 8833e2428 (2 Dec), before the four merges of main since (1adf8aaee, 99c12fd92, 2c43e42be, 43275e27c).

# Route Sent Test, or why none
1 Account menu's entry, as NavigationTarget (also the opendots rail and sidebar and the openduet menu sheet, which draw it so) one opened, account_menu opening OpenBot for Business > the account menu's entry, as a component …. The skins' copies aren't pressed: their click is the shared component's
2 Account menu's entry as a menu item's render (app sidebar wide and narrow, openfuse sheet) the same … as a menu item's render …; pressed through the real menu in app-navigation.test.tsx and narrow-sidebar-sheet.test.tsx
3 Home's Meet OpenBot for Business (BusinessLink) one opened, home … the home page's Meet OpenBot for Business …; business-link.test.tsx
4 An Admin page that applies only to a team (ForATeam) one opened, admin … an Admin page that applies only to a team …; each Admin route draws it (admin-personal-edition.test.tsx)
5 A Bot's computer line (BusinessComputerLink, in Setup, the new Bot sheet, Admin's capabilities) one opened, computer_line … a Bot's line about a computer of its own …; drawn, not pressed, by bot-public-words and new-bot-sheet
6 The self-hosting bar's Book a call (SelfHostBanner, in _app.tsx and three skin frames) one opened, self_host_banner … the self-hosting bar's Book a call …; self-host-banner.test.tsx
7 The spec's places against the app's the same six both ways … the spec's places are the app's signed-in ones, and no others
8 A booking in the dialog's calendar, from each of the six entries one booked by the entry that opened it; utm_content names it too a call booked in the dialog's calendar > %s: … (six cases)
9 event_scheduled from another origin, the page or another frame, or another Calendly message nothing … a message from another origin or frame sends nothing
10, 11 StrictMode and redraws, on opening and on a booking one opened; one booked … under StrictMode one press sends one opened, and drawing again sends nothing; … under StrictMode one booking sends one booked. Guards: see Red/green
12, 13, 29 Closed and opened again; an entry reached while open; two entries before the dialog draws a second opening by its own entry; nothing; one opening by the first … closed and opened again is a second opening …; … two entries reached before the dialog draws are one opening by the first …
14, 15, 26 Desktop's main window, including signed in to OpenBot Cloud or a company's OpenBot; a browser surface: desktop to the page's own server; surface: web … in OpenBot Desktop's window the opening says desktop; every test in rows 1-6
16 Team or personal organization to the organization the person is working in … it is counted in the organization the person is working in
17 Sign-out with the dialog open it closes; a later booking sends nothing; the next opening counts … signing out with it open closes it …
18 OpenBot Cloud's sign-in screen nothing OpenBot Cloud's sign-in screen sends nothing, on opening or for a booking
19, 33 The calendar can't load (dialog; onboarding's frame failing or offline) the opening only … a calendar that can't load counted the opening, and nothing more; when the calendar can't load (%s) …
20, 21 The count refused (400), 404, 503, no answer, a slow answer nothing on screen; the dialog never waits a count that does not arrive > … (five tests)
22, 23, 30 Onboarding: a booking; one from elsewhere; one whose count fails; one carrying Calendly's whole payload one booked, onboarding; nothing; Continue still replaces Not now; the three fields only a call booked in onboarding's calendar …; a booking whose count the server can't take …; a booking whose message carries Calendly's whole payload …
24 Onboarding's step: Book a demo pressed; the step on screen; Not now one opened, onboarding, for the press only Book a demo on onboarding's step sends one opened from onboarding; the step itself and Not now send none
31, 32, 34 Arriving at the step (four ways); coming back without pressing; the last step's Not now nothing; each press of Book a demo is one opened arriving at onboarding's OpenBot for Business step sends nothing: %s; coming back to onboarding's step …; on the last step, Not now …. Guards: see Red/green
35 The last step: Book a demo, a booking, Get started one opened, one booked on the last step, Book a demo is one opened and a booking one booked …
36, 39 Two tabs, a reopen, a second booking, a reload, the same day each is sent, with one event ID No app test: each tab sends its own. The server's clock-set tests and the real build below show the repeated ID
37 A switch of organization with the dialog open it closes before the new organization draws; no dialog or calendar there; a later booking sends nothing … switching organization with it open closes it and draws no dialog or calendar in the new one …
38 The same organization set again; the organization becoming known no change … the same organization again leaves the dialog open …
40-43 The next UTC day; another organization; slug against id; desktop against web a new ID; a new ID; one ID; two IDs the server's own tests (its clock set; the deployment's real sign-in)
25 Product telemetry off the app still sends; the server drops it the server's own tests, each off setting injected
27, 28 Desktop's setup window; the phone app and the Recorder unchanged; nothing no desktop/src change; neither has an entry or calendar

Red/green

Each turns one guard off in a scratch edit that is never committed, then puts it back. After each run the worktree is clean.

At the head (4 Dec). These are onboarding's, re-run after main's #2488 rewrote routes/_authed/onboarding.tsx, with business-events, onboarding-route and team-features-dialog (100 pass, 0 fail with nothing off):

  • Onboarding's recordBusiness("opened", "onboarding") off: 94 pass, 6 fail. The six are Book a demo on onboarding's step sends one opened …, coming back to onboarding's step …, on the last step, Book a demo is one opened …, a booking whose message carries Calendly's whole payload …, and both when the calendar can't load (%s) …. The failure: expect(received).toEqual(expected), expected [{"action":"opened","place":"onboarding","surface":"web"}], received [].
  • Onboarding's recordBusiness("booked", "onboarding") off: 96 pass, 4 fail. The four are a call booked in onboarding's calendar …, on the last step, Book a demo is one opened and a booking one booked …, a booking whose message carries Calendly's whole payload … and a booking whose count the server can't take …. The failure: expect(counts()).toEqual([OPENED, BOOKED]) received only OPENED, and Expected length: 1, Received length: 0.
  • Guards, counted in the click and never in an effect. These tests also pass on main, where nothing is sent, so they are guards, not regression tests. What each one catches:
    • With onboarding's opening moved to an effect as the step comes on screen: 93 pass, 7 fail. The seven are row 24's test, all four cases of row 31, row 32 and row 34. The failure: expect(businessEvents).toEqual([]) received one opened from onboarding.
    • With the dialog's opening moved to a mount effect in its calendar: 98 pass, 2 fail. Rows 10 and 11 fail because StrictMode's second effect sends a second opened (Expected - 0, Received + 5).
    • Two effects pass all 100: one keyed on the dialog's open flag, and one keyed on onboarding's calendar being on screen. Each fires exactly once per press in every route above, so they count the same. The tests don't tell those apart from the click.

At 75183a948 (2 Dec), on code the merges since haven't changed:

  • if (open) return; in openTeamFeatures off: 48 pass, 2 fail (… two entries reached before the dialog draws …, … closed and opened again …). Tests first: at 8acbba134 the first fails, the opening saying home while the calendar and the booking say admin. It passes with 261239cbd.
  • onOrganizationChange(() => setOpen(false)) off: 29 pass, 1 fail (row 37's test). Tests first: at ae819b689 it fails, with a dialog, a calendar and a booked from home left in the new organization. It passes with 677b1040a.
  • BookingCalendar's origin check off: 77 pass, 3 fail. Its frame check off: 78 pass, 2 fail. With both back on, 80 pass.
  • The sign_in guard in recordBusiness off: 29 pass, 1 fail (row 18). The dialog's close on unmount off: row 17 fails.
  • At 0ffb75e2a, with all three new calls off: 21 fail, 39 pass. Tests first for onboarding's opening: at a4a28c060 row 24's test expects one opened from onboarding and receives none. It passes with 991bfac20.

The server's red/green, for the per-day ID, is in its own change. With the organization, the surface or the day taken out of the key, or the day taken in Pacific time, 2 grain tests fail each time.

Local runs

At the head, 39a310e8b:

  • bun test app/tests/business-events.test.tsx app/tests/onboarding-route.test.tsx app/tests/team-features-dialog.test.tsx app/tests/business-link.test.tsx app/tests/app-navigation.test.tsx app/tests/narrow-sidebar-sheet.test.tsx app/tests/settings-usage-data.test.tsx scripts/ci-changes.test.ts: 208 pass, 0 fail.
  • bun run api:generate: no change. bun run api:lint: valid. bun run format:check: clean. bun run lint: clean, apart from one existing info in an untouched file (desktop/workbench/componentChain.test.ts).
  • bun run typecheck: clean at 43275e27c. The head adds only a docs sentence.

The whole app suite, at 99c12fd92 (3 Dec): 6273 pass, 2075 skip, 2 fail across 954 files. The 2 are task-thread.test.tsx's two link tests, in a file this branch doesn't touch. They fail the same way only inside the whole run on main too, and the file alone gives 26 pass, 0 fail. The suite hasn't been run again since; the merges since bring in main's own app changes (#2891, #2895, #2896, #2802, #2893, #2899, #2902, #2906), none in this branch's files. bun run build in app/ was last run at 0ffb75e2a (built in 50 s). oasdiff breaking isn't installed here; CI's API spec job runs it.

Real build

Two local runs drove the app's dev server against the server's production entry. The server ran on a fresh pgvector database, personal edition, one user, with telemetry pointed at a local capture stub (the server logged that resolved target before any event). Every process ran under a loopback-only sandbox (WebKit's helpers aside, below), and the browser reached no host but this machine. The calendar's frame was a local stand-in page served at Calendly's address, and a booking was Calendly's calendly.event_scheduled message with a synthetic appointment, posted from inside that frame, so the app's origin and frame checks applied. No real Calendly booking was made.

  • Chromium, 3 Dec 23:41-23:42 UTC, at ef0fcdb3a. Since then the app's own changes are the spec's description and docs, and the server now reads the clock once; in this run every day and occurred_at was 2026-12-03.
    • Telemetry on. Each step sent one request whose body was exactly {action, place, surface}, got 204, and produced one event at the stub. The steps: onboarding's Book a demo and a booking there; the account menu's entry, a booking, and a second booking (the same ID); the dialog closed and opened again (the same ID as the first opening); home's Meet OpenBot for Business. That is 7 events and 5 distinct IDs. For all 7, the user_id pseudonym and the ID, sha256 of <deployment_id>:business:<user_id>:default:<action>:<place>:web:2026-12-03, matched an independent recomputation. No property beyond the envelope and the three, and utm_content named the same place each time.
    • Telemetry off (OPENBOT_PRODUCT_TELEMETRY=0): 204 each, and no business event at the stub. With COPILOTKIT_TELEMETRY_DISABLED=true: 204 each, and nothing at the stub.
  • WebKit, 4 Dec 00:41-00:42 UTC, the same loopback build in headless Playwright WebKit 26.6 (playwright-core 1.63.0, a local WebKit build), with the server at 80b7a5f8 and the app at 43275e27c; the heads since add only the docs sentence. The steps were onboarding's Book a demo and a booking, the account menu's entry, a booking and a second booking, the reopen, and home. Each sent one request with exactly {action, place, surface}, got 204, and produced one event at the stub. That is 7 events and 5 distinct IDs (the second booking and the reopen repeated their IDs), every user_id and ID check passed (28 of 28), and every event said business_surface: web. WebKit's helper processes run outside the sandbox, so for the browser the guard was the context's request route, which answered the calendar frame locally and let nothing else leave. A socket watch on those processes saw no connection that wasn't loopback.

Not covered: the desktop surface in Desktop's real window (both runs were headless browsers, so surface: web); a second organization and a UTC midnight crossing in a browser (the server's tests cover both); Calendly's real calendar; receipt at the real ingest (below); and somebody else signing in on the same browser while an old tab's calendar is open (a booking there counts for whoever is signed in now, as every request from that tab does).

Visible change: none apart from row 37's flash, so no Chrome or Safari screenshots.

The telemetry ingest allows every oss.runtime. event by prefix, the path nudges take. I checked that on 2 Dec at 19:13 UTC and haven't checked it since.

CI

CI at 8cd96a35a (4 Dec): 36 pass, 3 skipped. The jobs this change reaches all passed: API spec (with oasdiff), tests (all 5 shards), the app real-browser jobs (Chromium, WebKit in 3 shards, and the desktop setup window) and release note. Skipped: component list, component dockerfile, and tests (changed files) (the full suite ran instead).

Still to do after merge

On staging's nightly or the release, read opened for one test account only; this is the receipt at the sink. The deployment needs product telemetry on, and whether staging has it isn't checked.

  1. Note the start time.
  2. Sign in alone, open OpenBot for Business from the account menu, close it, open it again, book nothing.
  3. Note the end time. The server sends two events with one ID.
  4. Read only that account's events on that deployment, within that window, read-only.

A booking is left out on purpose: the calendar is real, and booked takes the same route, sender and ingest rule as opened.

SELECT event, properties.business_place AS place,
       properties.business_surface AS surface,
       count() AS events,
       count(DISTINCT properties.event_id) AS person_days,
       count(DISTINCT concat(properties.deployment_id, ':',
                             properties.user_id)) AS people
FROM events
WHERE event IN ('oss.runtime.openbot.business_opened',
                'oss.runtime.openbot.business_booked')
  AND properties.app_id = 'openbot'
  AND properties.deployment_id = '<the test deployment id>'
  AND properties.user_id = '<the test account pseudonym>'
  AND timestamp BETWEEN '<the run's start>' AND '<the run's end>'
GROUP BY event, place, surface
ORDER BY event, place, surface

Expected: one row, business_opened | account_menu | web, with person_days 1 and people 1. events is 1 if PostHog keeps one event per ID. A 2 means both sends arrived; person_days and people still read 1. Keep the run inside one UTC day.

History

27 commits, merges only, with no force-push.

Merge order

  • This pull request merges first.
  • The server's half is a separate change, pushed after this one merges. It is pinned to this one's merge commit, its schemas are regenerated from it, its whole suite is run, and then it is pushed.
  • Until a server with it is deployed, the app's count gets a 404, which changes nothing on screen.

Rollback

Before a release, revert this pull request. After one, the operation stays, since a released app may call it and the API's 12-month rule applies. The counts stop wherever product telemetry is off, and a later release can stop the app sending them.

ACl365 added 28 commits December 2, 2026 15:32
…e app

Each signed-in entry to the OpenBot for Business dialog sends one opened, and a call booked in its calendar or in onboarding's sends one booked, to recordBusinessEvent, answered by the handler generated from the spec and held to its strict schema. A message from another origin or frame, StrictMode, a re-render, OpenBot Cloud's sign-in screen and signing out send nothing more; a count that does not arrive changes nothing on screen. These fail until the operation and the counts exist.
Adds recordBusinessEvent, POST /api/v2/organizations/{organizationId}/business-events, beside the nudges' endpoint with the same security and answers: a strict body of action (opened or booked), place (the web app's signed-in places) and surface (web or desktop), accepted and dropped where product telemetry is off.

Each entry to the OpenBot for Business dialog counts one opened as it is pressed, so StrictMode and a re-render count nothing more and a real reopen counts again. A call booked in the dialog's calendar or onboarding's counts one booked, from Calendly's origin and the calendar's frame only. Nothing is sent from OpenBot Cloud's sign-in screen, where nobody is signed in. A count is best effort, with keepalive and no retry, and never changes what is on screen.

docs/TELEMETRY.md and desktop/TELEMETRY.md say what is counted, when nothing is sent and what Desktop's setup window still counts; telemetry-queries.sql adds Query G.
The step is shown to every local evaluator unasked, so it is not counted; Book a demo, which puts the calendar on screen, sends one opened from onboarding, and Not now sends nothing. Fails until the step counts it.
Pressing Book a demo, which puts the calendar on the step, sends one opened from onboarding, as an entry to the dialog does; the step itself, shown to every local evaluator, and Not now send nothing. The spec's action, docs/TELEMETRY.md and desktop/TELEMETRY.md say so.
The StrictMode tests' redraw handed React the same element objects again, so it could skip the render they mean to make. Each redraw now builds new elements from the entry's builder, as a parent's render would. Both tests that redraw still pass: a press is one opened and a booking one booked.
Two entries reached before the dialog has drawn are one opening, by the first: its count, the calendar's utm_content and a call booked in it all name that entry. Closed and opened again from the other entry, all three name that one. Fails today: the second entry still overwrites the place, so the opening says home while the calendar and the booking say admin.
openTeamFeatures returns at once when the dialog is already open: no count, and the place is not overwritten. Two entries reached before the dialog draws were counted as opened by the first while the calendar's utm_content and a booking in it named the second. Now all three name the first, and closed and opened again is still a new opening by its own entry. docs/TELEMETRY.md says an entry reached while it is open changes nothing.
… one place

For each of the six signed-in entries (the account menu's two renderers, home, Admin, a Bot's computer line, the self-hosting bar): pressed, the dialog opens; its calendar's utm_content is the entry's place; a booking said by that calendar sends booked by the same place. The booking's message carries what Calendly sends with it, the event and the invitee by their API addresses (synthetic), and each body sent is exactly action, place and surface.
… pressed

Arriving at the step sends nothing: from Welcome's Continue, at the step the server saved, on a reload, and for an organization's person sent on to the name step. Coming back to it without pressing Book a demo sends nothing: Back, the list of steps, the browser's Forward and Back, and after Book a demo with its calendar still there. Each press of Book a demo is one opened, a reload's included. A calendar that can't load (its frame fails, or offline) counts the opening, and Book a call, which opens the website and moves on, sends nothing more. On the last step (name known), Not now opens the app and sends nothing, and Book a demo, a booking and Get started send one opened and one booked. A booking whose message carries Calendly's event and invitee (synthetic) sends exactly action, place and surface. docs/TELEMETRY.md says coming back to the step without pressing Book a demo sends nothing.
The app's type for what a person did with OpenBot for Business was written by hand, so the call only checked that the spec covered the app's two words. It is now BusinessEvent["action"] from the client generated from api/openapi.yaml, so the spec and the app name the same actions both ways. No generated file changes; the app typechecks.
docs/TELEMETRY.md: each opening and each booking is sent, and the event ID makes the counts people per deployment (the same person on another deployment is another ID); the surface is not in the ID, so a count by business_surface counts events, not people. The endpoint's 4 KiB limit, its Idempotency-Key (kept 24 hours whether telemetry is on or off; the same key and body get the first answer back and send nothing again; another body is a 409 conflict, and one still being answered a 409 to try again) and its empty 204, which is not a receipt, as for a nudge event. The app sends the count whatever the setting and its OpenBot decides: Desktop's own server is started with COPILOTKIT_TELEMETRY_DISABLED=1 while Share usage data is off (fresh_runtime_env), from its next start; OpenBot Cloud or a company's OpenBot follows its own setting.

docs/telemetry-queries.sql: Query G counts people per deployment by distinct event_id, says what the surface does to a count, and how a funnel across Desktop's setup window reads the place (coalesce(properties.business_place, properties.place)).
…ialog for good

The dialog sits inside OrganizationBoundary, as routes/_authed.tsx mounts it, and the person switches organization with it open. The old dialog and its calendar go, and the new organization draws no dialog, open or closing, and no calendar, so a booking said by any calendar frame after the switch is counted in neither organization; the next opening is counted in the new one. Fails today: the new organization's dialog reads the open flag before the old one's unmount closes it, so it is drawn again with a calendar of its own, which counts a booking as booked from home in the new organization.
…the new one is drawn

The open flag is closed by onOrganizationChange, at module level, as the query client, the left-organization notice and the kept transcripts follow a switch. Before, the layout built again for the new organization drew the dialog from the flag still open, with a calendar of its own that counted a booking as booked in the new organization, until the old dialog's unmount closed it a moment later. setCurrentOrganization tells nobody when the organization is the same, so the same organization again leaves the dialog open, and the organization becoming known at sign-in opens nothing; a test pins both. docs/TELEMETRY.md: switching organization closes the dialog, as signing out does.
Opening the dialog now counts the opening, and these tests had nowhere for the count to go: each opening printed "OpenBot for Business telemetry could not be delivered", 11 times in a run. The count is answered by the handler generated from api/openapi.yaml, on a page with an address, as business-events.test.tsx answers it, and any other request fails the test. 20 pass, with nothing in the console.
The home page's link, the sidebar and the narrow sidebar sheet open OpenBot for Business, and opening it now counts the opening. Their tests had nowhere for the count to go: business-link printed "could not be delivered" once, and app-navigation and narrow-sidebar-sheet, whose fetch answers 404 to everything, printed "was not accepted. 404" 3 times and once. business-link now answers the count with the handler generated from api/openapi.yaml, as team-features-dialog does, and fails on any other request; the other two answer the business-events address with the server's empty 204 and keep their 404 for everything else. 3, 22 and 9 pass, with nothing in the console.
…ess-once-a-day

# Conflicts:
#	docs/TELEMETRY.md
… person, organization, place, surface and UTC day
…ction, place, surface and UTC day; Query G counts person-days and people; Calendly counts bookings
…peats for the person, organization, place, surface and UTC day
…g, and Query G's people on known deployments only
…very other part is in the event, so candidate organization ids can be tried against it
@ACl365
ACl365 marked this pull request as ready for review December 4, 2026 11:19
@ACl365
ACl365 requested a review from davidmckayv as a code owner December 4, 2026 11:19

This branch has not been deployed

No deployments
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