You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when querying for some user batches, one may fail with an error like this:
1 validation error for PresenceBatchResponse 0.devices.0.titles.0.activity Input should be a valid list [type=list_type, input_value={'richPresence': 'Neptune: Story'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.5/v/list_type
I've done nothing but to provide a list of user ids to the xbl_client.presence.get_presence_batch method. There might be something in the validation or the responses that makes the whole batch invalid. Oddly enough, generally a few hours later the request executes successfully.
I am seeing the same error, but seemingly only once the account has transitioned from inactive to active.
On the times where the account is active and it does consistently return presence correctly, the device type is 'iOS'
It's all or nothing, once the account comes online, it either works every time or it doesn't
Is there a known issue, fix, or method to debug?
The command causing the error is: presence = await xbl_client.presence.get_presence(str(xuid), PresenceLevel.ALL)
Example: 1 validation error for PresenceItem devices.0.titles.1.activity Input should be a valid list [type=list_type, input_value={'richPresence': 'The City: The REC'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/list_type
Here are the different 'Input should be a valid list' errors I've seen. 'The Theater: 0P 0R 0A' is by far the most prevalent.
None of these are games that the user plays.
Input should be a valid list [type=list_type, input_value={'richPresence': 'The City'}, input_type=dict]
Input should be a valid list [type=list_type, input_value={'richPresence': 'The City: The REC'}, input_type=dict]
Input should be a valid list [type=list_type, input_value={'richPresence': 'The City: The Theater'}, input_type=dict]
Input should be a valid list [type=list_type, input_value={'richPresence': 'The Theater: 0P 0R 0A'}, input_type=dict]
The part that is causing the error is this: 'activity': { 'richPresence': 'The City' },
And if I change the last line to the following, removing the 'activity' section, it no longer fails:
data = resp.json()
# Iterate through each device
for device in data.get('devices', []):
# Iterate through each title in that device
for title in device.get('titles', []):
# Remove 'activity' if it exists
title.pop('activity', None)
json_string = json.dumps(data)
return PresenceItem.model_validate_json(json_string)
This pydantic check is the command causing the issue: PresenceItem.model_validate_json(json_string)
Activity
tomballgithub commentedon Jan 19, 2026
I am seeing the same error, but seemingly only once the account has transitioned from inactive to active.
On the times where the account is active and it does consistently return presence correctly, the device type is 'iOS'
It's all or nothing, once the account comes online, it either works every time or it doesn't
Is there a known issue, fix, or method to debug?
The command causing the error is:
presence = await xbl_client.presence.get_presence(str(xuid), PresenceLevel.ALL)Example:
1 validation error for PresenceItem devices.0.titles.1.activity Input should be a valid list [type=list_type, input_value={'richPresence': 'The City: The REC'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/list_typeHere are the different 'Input should be a valid list' errors I've seen. 'The Theater: 0P 0R 0A' is by far the most prevalent.
None of these are games that the user plays.
tomballgithub commentedon Jan 21, 2026
I noticed that the response from Xbox does not give an error when it's like this:
but it does give an error when it's this:
The part that is causing the error is this:
'activity': { 'richPresence': 'The City' },And if I change the last line to the following, removing the 'activity' section, it no longer fails:
This pydantic check is the command causing the issue:
PresenceItem.model_validate_json(json_string)tomballgithub commentedon Jan 21, 2026
The fix is to edit
\api\provider\presence\models.pyfrom:activity: list[ActivityRecord] | None = Noneto
activity: ActivityRecord | None = NoneThe activity record is defined as being a dict rather than a list. The current code is looking for a list.
https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/live/rest/json/json-titlerecord