jackwener/OpenCLI · error · CommandExecutionError

Instagram caption editor did not appear

Error message

Instagram caption editor did not appear

What it means

This variant of the caption-editor error is thrown after the click-to-advance step: if the upload stage later reports 'failed', the library rethrows an upload failure, otherwise it captures /tmp/instagram_post_caption_debug.png and throws because the caption editor never appeared. It means the publish flow did not reach the caption step.

Source

Thrown at clis/instagram/post.js:963

                    throw makeUploadFailure(uploadState.detail);
                }
                if (attempt < 2) {
                    continue;
                }
            }
            throw error;
        }
        await page.wait({ time: 1.5 });
        if (await hasCaptionEditor(page)) {
            return;
        }
        const uploadState = await inspectUploadStage(page);
        if (uploadState.state === 'failed') {
            throw makeUploadFailure(uploadState.detail);
        }
    }
    await page.screenshot({ path: '/tmp/instagram_post_caption_debug.png' });
    throw new CommandExecutionError('Instagram caption editor did not appear', 'Instagram may have changed the publish flow; inspect /tmp/instagram_post_caption_debug.png');
}
async function waitForCaptionEditor(page) {
    if (!(await hasCaptionEditor(page))) {
        await page.screenshot({ path: '/tmp/instagram_post_caption_debug.png' });
        throw new CommandExecutionError('Instagram caption editor did not appear', 'Instagram may have changed the publish flow; inspect /tmp/instagram_post_caption_debug.png');
    }
}
async function rethrowUploadFailureIfPresent(page, originalError) {
    const uploadState = await inspectUploadStage(page);
    if (uploadState.state === 'failed') {
        throw makeUploadFailure(uploadState.detail);
    }
    throw originalError;
}
async function focusCaptionEditorForNativeInsert(page) {
    const result = await page.evaluate(`
    (() => {
      const textarea = document.querySelector('[aria-label="Write a caption..."], textarea');

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Inspect /tmp/instagram_post_caption_debug.png to see the actual screen after advancing
  2. Handle any intermediate dialogs (save-password, contacts-sync) before posting
  3. Update the CLI to match a changed Instagram publish flow
  4. Retry; intermittent A/B UI variants may succeed on a second run

Example fix

// before
await postImage(page, 'photo.jpg');
// after
await dismissLoginInfoDialog(page); // close the 'Save your login info?' modal first
await postImage(page, 'photo.jpg');
Defensive patterns

Strategy: try-catch

Validate before calling

await dismissKnownDialogs(page); // close 'save login info', 'contacts sync' prompts before advancing

Try / catch

try {
  await advanceToCaptionEditor(page);
} catch (e) {
  if (String(e.message).includes('caption editor did not appear')) {
    // inspect /tmp/instagram_post_caption_debug.png
    await dismissKnownDialogs(page);
    await advanceToCaptionEditor(page);
  } else throw e;
}

Prevention

When it happens

Trigger: executeUiInstagramPost advances the composer, re-checks inspectUploadStage (rethrowing makeUploadFailure on state 'failed'), and on still no caption editor takes a debug screenshot and throws this error.

Common situations: Instagram changed the publish flow (new intermediate dialog), the Next click landed on a dialog the script doesn't understand, upload silently failed, or an account-level popup interrupting navigation.

Related errors


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