Skip to content

wip: AIT push feature documentation#3180

Open
owenpearson wants to merge 1 commit intomainfrom
ait-push
Open

wip: AIT push feature documentation#3180
owenpearson wants to merge 1 commit intomainfrom
ait-push

Conversation

@owenpearson
Copy link
Member

@owenpearson owenpearson commented Feb 4, 2026

WIP PR to add push notifications feature documentation for AIT.

Remaining work to do on this

  • test the ios client examples
  • test the android client examples
  • review overall direction and style

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ait-push

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 and usage tips.


Traditional AI chat interfaces require users to stay online while the agent works. This creates poor experiences for tasks that take minutes or hours:

* **Users can't multitask** - They must keep the app open and monitor progress
Copy link
Member

Choose a reason for hiding this comment

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

Please no bold in bullets like this. It's unnecessary and is an AI tell


## How push notifications work with AI Transport

Ably's push notification system integrates seamlessly with AI Transport patterns. When an agent completes a background task, you publish both a realtime message (for online users) and a push notification (for offline users). The platform handles delivery to the appropriate transport automatically.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Ably's push notification system integrates seamlessly with AI Transport patterns. When an agent completes a background task, you publish both a realtime message (for online users) and a push notification (for offline users). The platform handles delivery to the appropriate transport automatically.
Ably's push notification system integrates seamlessly with AI Transport patterns. When an agent completes a background task, you publish both a realtime message (for online users) and/or a push notification (for offline users). By supporting both transports through a unified API, Ably simplifies handling delivery via the most appropriate transport.

(The previous wording implied that Ably will automatically use one transport or the other.)


Ably's push notification system integrates seamlessly with AI Transport patterns. When an agent completes a background task, you publish both a realtime message (for online users) and a push notification (for offline users). The platform handles delivery to the appropriate transport automatically.

The recommended pattern is **channel publishing with push extras**:
Copy link
Member

Choose a reason for hiding this comment

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

no bold

4. Ably delivers via push (FCM, APNs, or Web Push) if user is offline
5. User receives notification and can resume session to view results

This approach provides a unified publishing API while automatically adapting to user connectivity state.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not convinced that unconditionally sending both should be our recommendation.


## Publishing push notifications on task completion

When your agent finishes a long-running task, publish a message with push notification payload to notify offline users.
Copy link
Member

Choose a reason for hiding this comment

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

Should this also mention alerting the user for HITL?

```
</Code>

The `collapseKey` ensures that multiple rapid completions replace previous notifications rather than stacking (on Android/iOS), while `data.taskId` enables precise navigation when users tap the notification.
Copy link
Member

Choose a reason for hiding this comment

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

Mention something about how you might address this for web push?

</Code>

<Aside data-type="important">
Avoid sending push notifications for every incremental update (like token streaming). Reserve push for meaningful milestones: task started, significant progress (>50% complete), or completion. Excessive notifications create poor user experiences and may trigger platform rate limits.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Avoid sending push notifications for every incremental update (like token streaming). Reserve push for meaningful milestones: task started, significant progress (>50% complete), or completion. Excessive notifications create poor user experiences and may trigger platform rate limits.
Avoid sending push notifications for every incremental update (such as every intermediate response in a longer task). Reserve push for meaningful milestones: task started, significant progress (>50% complete), or completion. Excessive notifications create poor user experiences and may trigger device rate limits.

updateProgressBar(message.data.progress);
});
```
</Code>
Copy link
Member

@paddybyers paddybyers Feb 5, 2026

Choose a reason for hiding this comment

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

Should there be some mention of the need to unsubscribe? For example the server could delete all subscriptions for a given channel when that conversation ends using removeWhere(params={channel:xxx})

For high-frequency agents or users with multiple concurrent sessions, implement server-side filtering to reduce notification noise.

### Presence-based notification filtering

Copy link
Member

Choose a reason for hiding this comment

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

I think this could do with an expanded introduction/motivation

</Code>

<Aside data-type="note">
Presence checks add latency (typically 50-200ms for global presence queries). For most applications, the simpler approach is to always include push extras and let client-side logic suppress notifications when the app is active. Presence-based filtering is most valuable for high-frequency updates or when minimizing notification count is critical.
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong. Checking presence as a realtime client does not involve any network interaction.


### Required setup steps

1. **Configure push credentials** in the Ably dashboard:
Copy link
Member

Choose a reason for hiding this comment

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

No bold

Copy link
Member

@paddybyers paddybyers left a comment

Choose a reason for hiding this comment

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

Some comments (I realise this is still draft)

Comment on lines +276 to +277
AblyRealtime realtime = new AblyRealtime("YOUR_API_KEY");
realtime.options.clientId = userId;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we shouldn't update options on the running client, and never suggest sdk users to do this. This can lead to errors. realtime.options - should be readonly

Suggested change
AblyRealtime realtime = new AblyRealtime("YOUR_API_KEY");
realtime.options.clientId = userId;
ClientOptions options = new ClientOptions();
options.key = "YOUR_API_KEY";
options.clientId = userId;
AblyRealtime realtime = new AblyRealtime(options);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants