jackwener/OpenCLI · error · CommandExecutionError

Instagram post share confirmation did not appear

Error message

Instagram post share confirmation did not appear

What it means

Thrown by waitForPublishSuccess when the probe never reports ok/failed/settled within the 90-iteration (~90 second) polling window. The CLI cannot confirm the post published; a final-state screenshot is saved before throwing.

Source

Thrown at clis/instagram/post.js:1265

            throw new CommandExecutionError('Instagram post share failed', 'Inspect /tmp/instagram_post_share_debug.png for the share failure state');
        }
        if (result?.ok) {
            return result.url || '';
        }
        if (result?.settled) {
            settledStreak += 1;
            if (settledStreak >= 3)
                return '';
        }
        else {
            settledStreak = 0;
        }
        if (attempt < 89) {
            await page.wait({ time: 1 });
        }
    }
    await page.screenshot({ path: '/tmp/instagram_post_share_debug.png' });
    throw new CommandExecutionError('Instagram post share confirmation did not appear', 'Inspect /tmp/instagram_post_share_debug.png for the final publish state');
}
async function resolveProfileUrl(page, currentUserId = '') {
    if (currentUserId) {
        const runtimeInfo = await resolveInstagramRuntimeInfo(page);
        const apiResult = await page.evaluate(`
      (async () => {
        const userId = ${JSON.stringify(currentUserId)};
        const appId = ${JSON.stringify(runtimeInfo.appId || '')};
        try {
          const res = await fetch(
            'https://www.instagram.com/api/v1/users/' + encodeURIComponent(userId) + '/info/',
            {
              credentials: 'include',
              headers: appId ? { 'X-IG-App-ID': appId } : {},
            },
          );
          if (!res.ok) return { ok: false };
          const data = await res.json();

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Inspect /tmp/instagram_post_share_debug.png to see what state the composer ended in
  2. Check whether the post actually went live by listing recent profile posts before retrying (avoid duplicates)
  3. Retry with smaller/compressed media or fewer items to fit the polling window
  4. Update the CLI / probe selectors if Instagram changed its composer markup
  5. Dismiss interfering dialogs (login challenges, save-info prompts) in the session before posting

Example fix

// before
throw new CommandExecutionError('Instagram post share confirmation did not appear', hint);
// after: check if the post actually landed before treating it as a failure
const existing = await captureExistingProfilePostPaths(page);
if (existing.length > baselineCount) {
  return existing[0];
}
throw new CommandExecutionError('Instagram post share confirmation did not appear', hint);
Defensive patterns

Strategy: try-catch

Validate before calling

// Confirm the session is healthy and no blocking modal is present before starting the share
const sessionOk = await page.evaluate(`!!document.querySelector('a[href$="/"]') && !document.querySelector('div[role="dialog"]')`);
if (!sessionOk) throw new Error('Instagram session or page state not ready for posting');

Type guard

function isConfirmedPublish(result) {
  return result !== null && typeof result === 'object' && typeof result.url === 'string' && result.url.length > 0;
}

Try / catch

try {
  await postToInstagram(media, caption);
} catch (e) {
  if (e instanceof CommandExecutionError && /confirmation did not appear/.test(e.message)) {
    // the post may still have landed — check profile posts before retrying to avoid duplicates
    const posts = await listRecentProfilePosts();
    if (posts.some((p) => p.caption === caption)) return;
    throw e;
  }
  throw e;
}

Prevention

When it happens

Trigger: clis/instagram/post.js share click succeeded but the success confirmation (post URL / dialog) never appeared within 90 seconds of 1-second polls — slow upload, page navigated away, dialog markup changed, or publish silently stalled.

Common situations: Very large video uploads exceeding the 90s budget; Instagram A/B UI change that hides the confirmation element the probe looks for; a modal (e.g. 'Save your info') intercepting the flow; session degraded so publish hangs.

Related errors


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