jackwener/OpenCLI · error · CommandExecutionError

Midjourney ${slotLabel} reference assignment was not verifie

Error message

Midjourney ${slotLabel} reference assignment was not verified

What it means

Thrown when verifyReferenceTarget cannot confirm the dragged image actually landed in the labeled slot. The in-page check looks for the labeled slot containing a button/img and not showing the 'Select image(s) below' placeholder; if it still looks empty, assignment is deemed unverified.

Source

Thrown at clis/midjourney/utils.js:1089

async function verifyReferenceTarget(page, slotLabel) {
  const assigned = unwrapEvaluateResult(await page.evaluate((label) => {
    const labelNode = [...document.querySelectorAll('div,span')]
      .find((node) => node.children.length === 0 && node.textContent?.trim() === label);
    if (!labelNode) return false;
    const peerLabels = ['Image Prompts', 'Style References', 'Omni Reference'].filter((item) => item !== label);
    let target = labelNode;
    for (let depth = 0; depth < 8 && target?.parentElement; depth += 1) {
      target = target.parentElement;
      const text = target.textContent || '';
      if (peerLabels.some((peer) => text.includes(peer))) break;
      const empty = [...target.querySelectorAll('div')]
        .some((node) => /^Select images? below$/i.test(node.textContent?.trim() || ''));
      if (!empty && target.querySelector('button,img')) return true;
    }
    return false;
  }, slotLabel));
  if (!assigned) throw new CommandExecutionError(`Midjourney ${slotLabel} reference assignment was not verified`);
}

export async function uploadReferenceLibrary(page, localPaths) {
  if (!localPaths.length) return [];
  await openImagePanel(page);
  const beforeSources = await visibleImageSources(page);
  const before = new Set(beforeSources);
  let captureReady = false;
  if (typeof page.installInterceptor === 'function'
    && typeof page.getInterceptedRequests === 'function'
    && typeof page.waitForCapture === 'function') {
    try {
      await page.installInterceptor('/api/storage-upload-file');
      await page.getInterceptedRequests();
      captureReady = true;
    } catch {}
  }
  let uploaded = false;

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Increase the post-drag wait (page.wait) or implement polling until verifyReferenceTarget returns true.
  2. Verify the drag coordinates/hit target; use native drag events if the Bridge supports them.
  3. Check that the uploaded image URL actually appears in the visible image sources before verifying.
  4. Retry the drag once, then fall back to the file-input upload path.

Example fix

// before
await page.drag('[data-opencli-ref-source="1"]', '[data-opencli-ref-target="1"]');
await page.wait(0.8);
await verifyReferenceTarget(page, label);
// after
await page.drag('[data-opencli-ref-source="1"]', '[data-opencli-ref-target="1"]');
for (let i = 0; i < 5; i++) {
  await page.wait(1);
  try { await verifyReferenceTarget(page, label); break; } catch {}
}
Defensive patterns

Strategy: retry

Try / catch

try {
  await verifyReferenceTarget(page, label);
} catch (err) {
  if (String(err.message).includes('not verified')) {
    await page.wait(2);
    await verifyReferenceTarget(page, label);
  } else throw err;
}

Prevention

When it happens

Trigger: After page.drag of the marked source onto the marked target, the slot still displays its placeholder; drag event was not accepted by the app; verification ran too soon (0.8s wait insufficient).

Common situations: Slow network so the uploaded thumbnail hasn't rendered; Midjourney's drop handler rejects synthetic drag events; the drag landed on the wrong slot; label matched multiple nodes.

Related errors


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