Python SDK token refresh behavior in custom agent desktop

I have been building a custom agent desktop widget using the Embeddable Client App SDK and I noticed something weird with the authentication flow. The access token expires after an hour which is normal but I want to make sure the refresh happens automatically without my code crashing the UI. I am using the Python Platform SDK to fetch some initial configuration data from Genesys Cloud before the widget mounts. Here is the snippet I am using to set up the client:

from genesyscloud.platform_client import PlatformClient

client = PlatformClient()
client.auth_settings.access_token = 'my_initial_token'
client.auth_settings.refresh_token = 'my_refresh_token'
client.auth_settings.client_id = 'my_client_id'
client.auth_settings.client_secret = 'my_client_secret'

I assumed that once I set these settings the SDK would handle the refresh logic internally. But when I run a long poll every 5 seconds to check for new tasks the requests start failing with 401 Unauthorized after the first hour. I thought the SDK was supposed to intercept the 401 and refresh the token automatically. Is there a specific method I need to call to enable this auto-refresh behavior or do I have to implement my own refresh loop? I have tried calling client.auth.refresh() manually but that seems to block the event loop. I want to avoid writing a complex retry mechanism if the SDK already supports it. Any help would be appreciated.