jackwener/OpenCLI · error · CommandExecutionError

LinkedIn messengerMessages URL is missing the conversation o

Error message

LinkedIn messengerMessages URL is missing the conversation owner identity.

What it means

After parsing all pages, parseThreadPages derives the conversation owner URN via ownerUrnFromApiUrls(apiUrls). It throws when no owner identity can be extracted from any captured messengerMessages request URL, since the owner URN is required to distinguish the signed-in user from the counterparty when computing recipientNames.

Source

Thrown at clis/linkedin/thread-snapshot.js:250

      throw new CommandExecutionError('LinkedIn messengerMessages payload is missing a message collection.');
    }
    for (const entity of normalized.included) {
      if (!entity || typeof entity !== 'object' || Array.isArray(entity)) {
        throw new CommandExecutionError('LinkedIn messengerMessages payload contains a malformed included entity.');
      }
      if (entity.entityUrn) {
        const existing = entities.get(entity.entityUrn);
        if (!existing || Object.keys(entity).length > Object.keys(existing).length) {
          entities.set(entity.entityUrn, entity);
        }
      }
    }
    apiUrls.push(page.url);
  }

  const ownerUrn = ownerUrnFromApiUrls(apiUrls);
  if (!ownerUrn) {
    throw new CommandExecutionError('LinkedIn messengerMessages URL is missing the conversation owner identity.');
  }

  const participants = Array.from(entities.values()).filter(
    (entity) => entity.$type === 'com.linkedin.messenger.MessagingParticipant',
  );
  const recipientNames = Array.from(new Set(participants
    .filter((participant) => participant.hostIdentityUrn !== ownerUrn)
    .map(participantName)
    .filter(Boolean)));
  if (recipientNames.length === 0) {
    throw new CommandExecutionError('LinkedIn messengerMessages payload is missing the counterparty participant.');
  }

  const byMessageId = new Map();
  for (const entity of entities.values()) {
    if (entity.$type !== 'com.linkedin.messenger.Message') continue;
    const messageId = normalizeWhitespace(entity.entityUrn || entity.backendUrn || entity.originToken);
    if (!messageId) {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Update the library so ownerUrnFromApiUrls matches LinkedIn's current messengerMessages URL format
  2. Re-run the snapshot and confirm captured request URLs still contain the owner identity segment/query param
  3. Verify no proxy or extension is stripping query parameters from the captured API URLs
  4. Pass the canonical LinkedIn messaging thread URL via --thread-url so URL matching has the expected format

Example fix

// before: captured URL missing owner identity
https://www.linkedin.com/voyager/api/voyagerMessagingGraphQL/graphql?queryId=messengerMessages.abc
// after: ensure the expected owner param is present in captured URLs
https://www.linkedin.com/voyager/api/voyagerMessagingGraphQL/graphql?queryId=messengerMessages.abc&owner=urn:li:fsd_profile:ACoAAA...
Defensive patterns

Strategy: validation

Validate before calling

function hasOwnerIdentity(urls) {
  return Array.isArray(urls) && urls.some(u => /owner=urn:li|ownerUrn/i.test(u));
}
// pre-check captured API URLs before parsing

Type guard

const hasOwnerParam = (url) => { try { return new URL(url).searchParams.has('owner'); } catch { return false; } };

Try / catch

try {
  const snap = await run('linkedin thread-snapshot', { 'thread-url': url });
} catch (err) {
  if (String(err.message).includes('missing the conversation owner identity')) {
    // upgrade parser / verify captured URL format
  } else throw err;
}

Prevention

When it happens

Trigger: Every page.url captured lacks the owner identity parameter/segment the parser looks for — e.g. the interceptor captured GraphQL requests whose URLs don't embed the owner's member URN, or ownerUrnFromApiUrls fails to match its URL pattern.

Common situations: Capturing from a LinkedIn session where the messaging URL format changed; scraping via an endpoint variant without the owner query param; a proxy stripping query parameters; running against a different locale/domain whose URLs don't match the expected pattern.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/b0c9479e19177108. Report an issue: GitHub.