jackwener/OpenCLI · error · CommandExecutionError
Twitter profile response for @${screenName} is missing profi
Error message
Twitter profile response for @${screenName} is missing profile identity fields What it means
CommandExecutionError thrown by mapTwitterProfileResult when the response has legacy/core objects but none of the identity fields (screen_name, name, created_at) are present in either — the payload is structurally recognizable but carries no usable identity data.
Source
Thrown at clis/twitter/profile.js:53
if (typeof value === 'number' && Number.isFinite(value))
return value;
}
return 0;
}
export function mapTwitterProfileResult(result, screenName) {
if (!isPlainObject(result)) {
throw new CommandExecutionError(`Twitter profile response for @${screenName} is malformed`);
}
const hasLegacy = isPlainObject(result.legacy);
const hasCore = isPlainObject(result.core);
if (!hasLegacy && !hasCore) {
throw new CommandExecutionError(`Twitter profile response for @${screenName} is missing profile fields`);
}
const legacy = hasLegacy ? result.legacy : {};
const core = hasCore ? result.core : {};
if (!stringField(core.screen_name) && !stringField(legacy.screen_name) && !stringField(core.name) && !stringField(legacy.name) && !stringField(core.created_at) && !stringField(legacy.created_at)) {
throw new CommandExecutionError(`Twitter profile response for @${screenName} is missing profile identity fields`);
}
const location = isPlainObject(result.location) ? result.location : {};
const expandedUrl = stringField(result.website?.url) || stringField(legacy.entities?.url?.urls?.[0]?.expanded_url);
return [{
screen_name: stringField(core.screen_name) || stringField(legacy.screen_name) || screenName,
name: stringField(core.name) || stringField(legacy.name),
bio: stringField(result.profile_bio?.description) || stringField(legacy.description),
location: stringField(location.location) || stringField(legacy.location),
url: stringField(expandedUrl),
followers: countField(result.relationship_counts?.followers, legacy.followers_count, legacy.normal_followers_count),
following: countField(result.relationship_counts?.following, legacy.friends_count),
tweets: countField(result.tweet_counts?.tweets, legacy.statuses_count),
likes: countField(result.action_counts?.favorites_count, legacy.favourites_count),
verified: Boolean(result.is_blue_verified || result.verification?.verified || legacy.verified),
created_at: stringField(core.created_at) || stringField(legacy.created_at),
}];
}
View on GitHub (pinned to 49907e53dc)
Solutions
- Refresh the session and retry — cached partial payloads can resolve on a fresh request
- Check whether the account is withheld/restricted in your region
- Dump the raw response in the browser (or via a debug flag) to see where identity fields moved
- If identity fields relocated to a new container, update mapTwitterProfileResult to read them
Defensive patterns
Strategy: type-guard
Type guard
function hasIdentityFields(core, legacy) {
const s = (v) => typeof v === 'string' && v.length > 0;
return [core?.screen_name, legacy?.screen_name, core?.name,
legacy?.name, core?.created_at, legacy?.created_at].some(s);
} Try / catch
try {
const profile = await opencli('twitter profile', { username });
} catch (e) {
if (e.name === 'CommandExecutionError' && /missing profile identity fields/.test(e.message)) {
console.warn('Payload had legacy/core but no identity data — likely restricted/withheld account');
} else throw e;
} Prevention
- Check whether the account is region-withheld or restricted
- Refetch with a fresh session to rule out cached partial payloads
- Inspect the raw response once to see where X moved identity fields
- Handle fallback display of '@handle' when identity fields are absent
When it happens
Trigger: result.legacy and result.core both exist but every one of core.screen_name, legacy.screen_name, core.name, legacy.name, core.created_at, legacy.created_at is absent/not a string — e.g. a truncated or redacted user object, or X moved identity fields elsewhere.
Common situations: X adding a new container and emptying legacy/core; country-withheld or restricted accounts returning stripped objects; caching layers returning partial payloads; pagination/selection grabbing the wrong object.
Related errors
- Twitter profile response for @${screenName} is malformed
- Twitter profile response for @${screenName} is missing profi
- 字幕条目缺少 subtitle_url 字段
- Twitter device-follow response was missing the expected time
- Twitter device-follow entries could not be joined to tweet/u
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/9cc0f351dcf0ad50.
Report an issue: GitHub.