jackwener/OpenCLI · error · CommandExecutionError
Could not open the uploaded image action menu for Describe
Error message
Could not open the uploaded image action menu for Describe
What it means
After uploading the image, describe locates the uploaded image card in the Midjourney DOM, tags its action-menu button with a data attribute, and clicks it. If page.evaluate cannot find/mark the button (menuMarked falsy), a CommandExecutionError is thrown because the Describe flow cannot proceed without opening that menu.
Source
Thrown at clis/midjourney/describe.js:77
if (prompts.length >= 4) {
groups.push(prompts.slice(0, 4));
break;
}
}
}
return groups;
});
const menuMarked = await page.evaluate((url) => {
const image = [...document.querySelectorAll('img[src]')].find((node) => node.src === url);
let card = image;
while (card && !String(card.className).includes('group/img')) card = card.parentElement;
const button = card?.querySelector('button');
if (!button) return false;
button.setAttribute('data-opencli-describe-menu', '1');
return true;
}, sourceUrl);
if (!menuMarked) {
throw new CommandExecutionError('Could not open the uploaded image action menu for Describe');
}
await page.click('[data-opencli-describe-menu="1"]');
await page.wait(0.4);
const startedAt = new Date().toISOString();
const clicked = await page.evaluate(() => {
const button = [...document.querySelectorAll('button,[role="menuitem"]')]
.find((node) => node.textContent?.trim() === 'Describe' && node.getBoundingClientRect().width > 0);
if (!button) return false;
button.click();
return true;
});
if (!clicked) throw new CommandExecutionError('Midjourney did not expose a Describe action for the uploaded image');
const deadline = Date.now() + timeout * 1000;
let prompts = [];
while (Date.now() < deadline) {
const groups = await page.evaluate(() => {
const visible = (node) => {View on GitHub (pinned to 49907e53dc)
Solutions
- Retry the command — transient render/upload lag often resolves it
- Increase the wait before the evaluate step (e.g. wait for the card selector instead of a fixed delay)
- Update the DOM selector / data-attribute marking logic in describe.js to match the current Midjourney UI
- Verify the upload itself succeeded (check uploadReferenceLibrary returned a valid sourceUrl) and that the account can view the uploaded image
- Check whether the image was rejected/needs moderation, which suppresses the action menu
Example fix
// before
if (!menuMarked) throw new CommandExecutionError('Could not open the uploaded image action menu for Describe');
// after
await page.waitForSelector(`img[src*="${sourceUrl}"]`, { timeout: 10000 }).catch(() => {});
const menuMarked = await page.evaluate(...); // retry once on failure
if (!menuMarked) throw new CommandExecutionError('Could not open the uploaded image action menu for Describe'); Defensive patterns
Strategy: retry
Validate before calling
// pre-check the uploaded card exists before marking the menu button
const cardReady = await page.waitForSelector(`img[src*="${sourceUrl}"]`, { timeout: 10000 }).then(() => true).catch(() => false);
if (!cardReady) throw new Error('Uploaded image card not rendered; aborting before Describe menu step'); Try / catch
try {
await describe(page, kwargs);
} catch (err) {
if (err instanceof CommandExecutionError && err.message.includes('action menu for Describe')) {
await page.wait(1.5); // let the card finish rendering
await describe(page, kwargs); // single retry
} else throw err;
} Prevention
- Retry once after a short delay — card rendering is often just slow
- Wait on an explicit card/image selector instead of fixed waits
- Pin/re-check the automation selectors whenever the Midjourney web UI updates
- Confirm uploadReferenceLibrary returned a usable sourceUrl before the menu step
- Verify the image was accepted (not moderated/removed) by the account
When it happens
Trigger: The upload succeeded but the card's action-menu button is missing/renamed in Midjourney's UI, sourceUrl does not match the rendered card, or the page state is stale/slow (card not yet rendered when evaluate runs).
Common situations: Midjourney web UI redesign changing button selectors; slow uploads so the card appears after the check; account/locale variations altering the DOM; the image failing to render (moderation, expired upload).
Related errors
- UISDC news selector drift: ${reason}
- Not a git repository
- AIbase daily selector drift: ${reason}
- 该聊天缺少 securityId,无法获取历史消息
- Boss recruiter history response did not include a message li
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/c372072ef6751a3c.
Report an issue: GitHub.