jackwener/OpenCLI · error · CommandExecutionError

Sales Navigator post-send verification failed

Error message

Sales Navigator post-send verification failed

What it means

After sending the InMail, the library verifies success by re-checking remaining credits and scanning the recipient's Sales Navigator lead page text for evidence of the sent message. If the sent activity cannot be found on the lead page, it throws rather than reporting a false 'sent' status.

Source

Thrown at clis/linkedin/salesnav-message.js:324

        inmail_restriction: summary.inmail_restriction,
        open_link: summary.open_link,
      }];
    }

    const sendResult = requireFetchResult(unwrapEvaluateResult(await page.evaluate(fetchJsonScript(MESSAGE_ACTION_URL, csrf, {
      method: 'POST',
      accept: 'application/vnd.linkedin.normalized+json+2.1',
      body: payload,
    }))), 'LinkedIn Sales Navigator message API', { requireJson: false });
    void sendResult;
    await page.wait(3);
    const creditsAfterResult = requireFetchResult(unwrapEvaluateResult(await page.evaluate(fetchJsonScript(CREDITS_URL, csrf))), 'LinkedIn Sales Navigator credits API after send');
    const creditsAfter = extractRemainingCredits(creditsAfterResult?.json);
    await page.goto(salesLeadUrlFromParts(recipient));
    await page.wait(6);
    const salesPageText = unwrapEvaluateResult(await page.evaluate('document.body ? document.body.innerText : ""'));
    const sentInSalesNav = salesPageShowsSentMessage(salesPageText, summary.recipient);
    if (!sentInSalesNav) throw new CommandExecutionError('Sales Navigator post-send verification failed', 'Sent activity was not found on the Sales Navigator lead page.');
    return [{
      status: 'sent',
      recipient: summary.recipient,
      title: summary.title,
      company: summary.company,
      credits_remaining: creditsAfter,
      credits_before: creditsRemaining,
      credits_after: creditsAfter,
      sent_in_salesnav: sentInSalesNav,
      message_chars: body.length,
      subject_chars: subject.length,
      recipient_urn: recipient.entityUrn,
      degree: summary.degree,
      inmail_restriction: summary.inmail_restriction,
      open_link: summary.open_link,
    }];
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Check the credits API result: if credits decreased, the message was actually sent and only verification failed — treat it as sent, but verify manually once.
  2. Re-open the recipient's Sales Navigator lead page and check for the message in the activity panel manually.
  3. Increase the wait/retry the lead-page verification (or re-run the send only after confirming credits were NOT consumed, to avoid duplicates).

Example fix

// before
await sendAndVerify(recipient, { subject, body });
// after
const before = await getCredits();
try {
  await sendAndVerify(recipient, { subject, body });
} catch (e) {
  const after = await getCredits();
  if (after < before) return { status: 'likely-sent', note: 'credits consumed; verify manually' };
  throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

const before = await getCredits();
if (before == null) throw new Error('Cannot read credits; aborting send to avoid unverifiable state');

Type guard

function isVerifiedSent(result) {
  return result && result.status === 'sent' && typeof result.credits_remaining === 'number';
}

Try / catch

try {
  await sendAndVerify(recipient, { subject, body });
} catch (e) {
  const after = await getCredits();
  if (after != null && before != null && after < before) {
    return { status: 'likely-sent', verifyManually: true };
  }
  throw e;
}

Prevention

When it happens

Trigger: The create-message call may have failed server-side, the lead page text did not contain the expected sent-message markers (pageShowsSentMessage match failed), or the lead page render/timing was insufficient so the activity had not loaded within the 6-second wait.

Common situations: Slow Sales Navigator page rendering causing verification to run too early; message actually rejected by LinkedIn after credits were polled; UI text/markup changed so the sent-activity heuristic no longer matches; network hiccup during page.goto.

Related errors


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