Skip to content

Add assistant join wait/timeout/poll-rescue metrics#2

Open
yewreeka wants to merge 2 commits into
mainfrom
jarod/assistant-join-metrics
Open

Add assistant join wait/timeout/poll-rescue metrics#2
yewreeka wants to merge 2 commits into
mainfrom
jarod/assistant-join-metrics

Conversation

@yewreeka
Copy link
Copy Markdown

@yewreeka yewreeka commented Jun 5, 2026

Why

Convos iOS users sometimes watch the agent "Joining…/verifying" state until the agent backend gives up (~2 minutes). We suspect the client's XMTP message stream dies silently, so the agent's join-request DM never gets processed. convos-ios#1004 adds a temporary client-side polling fallback to diagnose this; these metrics make the problem (and the wait users experience) measurable in PostHog.

New events

Event Fired when Parameters
assistant_joined A verified assistant actually appears in the conversation member list after a join was requested wait_duration (secs watching the joining state), surface (status_message / contact_card / builder_placeholder), member_count
assistant_join_timed_out No verified assistant arrived within the client wait window wait_duration, surface
assistant_join_rescued_by_polling The iOS polling fallback processed a join request the realtime stream missed — direct evidence of a dead stream stream_age_secs (time since the stream last delivered anything, -1 = never), poll_tick

Added in a follow-up commit: conversation_join_timed_out (wait_duration, source) — the standard invite-join counterpart: emitted when a joiner sits in the "Verifying" state past the client wait window because the creator's device never approved the join request. Complements joined_conversation.verification_duration, which only samples successes.

Funnel: added_assistant (exists) → assistant_joined gives stuck-rate and wait-duration distribution; assistant_join_rescued_by_polling gives the stream-death rate.

Descriptor change in metrics/descriptors/.../core/CoreActions.kt + regenerated Swift package and README catalog via ./gradlew build. swift build passes on the regenerated package.

Consumer PR: convos-ios#1005 (stacked on convos-ios#1004). Merge this first, then flip the iOS convos-shared pin back to main.

🤖 Generated with Claude Code

Note

Add assistant join wait, timeout, and poll-rescue metrics to CoreActions

Adds four new metric events to track assistant join lifecycle: assistant_joined, assistant_join_timed_out, assistant_join_rescued_by_polling, and conversation_join_timed_out. Each event captures relevant properties such as wait duration, surface, member count, stream age, and poll tick. Introduces a new AssistantJoinSurface enum with cases statusMessage, contactCard, and builderPlaceholder mapped to stable string identifiers for use in metric payloads. Changes are applied to both the Swift (CoreActions.swift) and Kotlin (CoreActions.kt) definitions.

Macroscope summarized db0dde4.

Instruments the gap after agents/join where the user watches the
assistant joining/verifying state:

- assistant_joined: a verified assistant appeared in the member list;
  wait_duration is the seconds spent watching, surface is where the
  user was watching (status message bubble, contact card, or agent
  builder placeholder).
- assistant_join_timed_out: no verified assistant arrived within the
  client wait window (the assistant backend gives up after ~2 minutes).
- assistant_join_rescued_by_polling: the iOS client's temporary
  join-request polling fallback processed a join request the realtime
  message stream missed - direct evidence of a silently dead stream,
  with stream_age_secs reporting how stale the stream was.

Descriptor change + regenerated Swift package and README catalog
(./gradlew build in metrics/).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 5, 2026
@macroscopeapp
Copy link
Copy Markdown

macroscopeapp Bot commented Jun 5, 2026

Approvability

Verdict: Approved

Purely additive telemetry changes - adds new metrics events for tracking assistant join wait times, timeouts, and polling rescues. No existing behavior modified; all new code simply fires analytics events with timing properties.

You can customize Macroscope's approvability policy. Learn more.

joinedConversation's verification_duration only samples successful
joins. When the conversation creator's device never approves the join
request (offline, or its message stream died), the joiner sits in the
"Verifying" state with no telemetry at all. conversation_join_timed_out
reports that wait: emitted by the client when the join wait window
elapses without the conversation becoming ready, with the same source
breakdown (url / scan / paste) as joined_conversation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@macroscopeapp macroscopeapp Bot dismissed their stale review June 5, 2026 23:11

Dismissing prior approval to re-evaluate db0dde4

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