UX when Character Session Concurrency is reached

Hello,

Could you provide clarification on how Character Session Concurrency is handled internally?

I need to implement logic in my application to notify users when the concurrency limit defined by the subscription plan is reached. For example, I would like to display a message such as “Please wait…” while the limit is reached and remove it when a session slot becomes available.

Specifically, I would like to understand when a concurrency slot is considered occupied and released.

For example:

  1. Is a concurrency slot counted when the application connects to the Convai service successfully, and then released only when the user exits/closes the application?

  2. Or is concurrency counted only when an actual avatar interaction begins (for example when a request to the character interaction API is initiated), and then released when that interaction or conversation session ends?

  3. If concurrency is exceeded, does the API return a specific error that can be used programmatically to detect that the limit has been reached?

My goal is to implement a client-side waiting mechanism so that when the concurrency limit is reached, users are informed for the purpose of UX.

Any clarification on how session lifecycle and concurrency allocation work would be greatly appreciated.

Thank you!

Hello,

There’s no special, separate mechanism exposed just for concurrency.

On your side, you should treat it like any other API failure: when you receive an error in the response, trigger your own retry / please wait logic.

Thank you K3,

Based on the official documentation, error handling is implemented using the following pattern:

try {
await client.connect(config);
} catch (err) {
console.error(‘Connection failed’, err);
}

From my understanding, this catches errors that occur when establishing the connection to the Convai service.

However, would this also catch API request errors that occur during runtime interactions (for example when sending an interaction request to the character)? Specifically, I would like to detect when the Character Session Concurrency limit is reached in order to implement a client-side “Please wait…” message, as stated in my previous message.

Thank you!

As mentioned, there is currently no specific event for concurrency. You can handle it through the general error event for now.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.