jackwener/OpenCLI · error · CommandExecutionError
xiaohongshu/delete-note: 已发布 tab not found on note-manager;
Error message
xiaohongshu/delete-note: 已发布 tab not found on note-manager; xhs creator UI may have changed.
What it means
Step 1 of the flow clicks the 已发布 (Published) tab in the note manager. The injected script returns false if no matching clickable element is found, and the CLI raises this CommandExecutionError because delete actions only exist on the Published tab — without switching to it the tool cannot proceed. The message also warns that XHS's creator UI markup may have changed.
Source
Thrown at clis/xiaohongshu/delete-note.js:187
if (typeof currentUrl === 'string' && /\/login(?:[/?#]|$)/i.test(new URL(currentUrl).pathname + new URL(currentUrl).search)) {
throw new AuthRequiredError('creator.xiaohongshu.com');
}
// Step 1: ensure 已发布 tab is active (delete only exposed there).
const tabClicked = requireEvaluateBoolean(unwrapEvaluateResult(await page.evaluate(`
() => {
const isVisible = (el) => !!el && el.offsetParent !== null;
for (const el of document.querySelectorAll('a, button, [role="tab"], div')) {
const text = (el.innerText || el.textContent || '').trim();
if (text === '已发布' && isVisible(el)) {
el.click();
return true;
}
}
return false;
}
`)), 'published-tab');
if (!tabClicked) {
throw new CommandExecutionError('xiaohongshu/delete-note: 已发布 tab not found on note-manager; xhs creator UI may have changed.');
}
await page.wait({ time: ROW_SETTLE_MS / 1000 });
// Step 2: locate the .note row whose data-impression JSON carries the
// exact `noteId` field. Dry-run stops here; execute clicks delete.
// Substring matching on the raw attribute would risk matching unrelated
// fields whose values happen to share the noteId prefix, so parse the JSON
// and compare `noteTarget.value.noteId` explicitly.
const initResult = requireActionResult(unwrapEvaluateResult(await page.evaluate(buildLocateAndMaybeDeleteScript(noteId, execute))), 'locate-note');
if (!initResult?.ok) {
if (initResult?.kind === 'not_found') {
throw new EmptyResultError('xiaohongshu/delete-note', `Note ${noteId} not visible in the 已发布 tab. Verify the note belongs to the logged-in account and has cleared review (审核中 / 未通过 rows have no web delete entry).`);
}
if (initResult?.kind === 'no_delete_action') {
throw new CommandExecutionError(`xiaohongshu/delete-note: note ${noteId} row found but no delete action visible; xhs creator UI may have changed.`);
}
throw new CommandExecutionError('xiaohongshu/delete-note: failed to locate note row');
}
if (!execute) {View on GitHub (pinned to 49907e53dc)
Solutions
- Re-run the command; transient slow rendering can be the cause (increase settle time if configurable)
- Check that the browser UI language for creator.xiaohongshu.com is Chinese (中文) so the 已发布 tab label matches
- Verify in a real browser that the note-manager page still shows an 已发布 tab; if XHS changed the DOM, the CLI's selector logic needs updating
- Update the library to a newer version that tracks the current XHS creator UI
Defensive patterns
Strategy: retry
Validate before calling
// Pre-check the tab exists before invoking delete:
const hasTab = await page.evaluate(`() => {
for (const el of document.querySelectorAll('a, button, [role="tab"], div')) {
if ((el.innerText || '').trim() === '已发布') return true;
}
return false;
}`);
if (!hasTab) throw new Error('已发布 tab not rendered yet'); Try / catch
try {
await cli('xiaohongshu', 'delete-note', { note: noteId });
} catch (err) {
if (err instanceof CommandExecutionError && err.message.includes('已发布 tab not found')) {
// retry once after settling, then surface UI-change
await sleep(3000);
return cli('xiaohongshu', 'delete-note', { note: noteId });
}
throw err;
} Prevention
- Keep the browser UI language for XHS set to Chinese (中文) so tab labels match
- Retry once after a delay before assuming a UI change
- Track opencli updates — XHS frontend redesigns require selector updates
- Ensure network is fast enough that the page settles within the 3s window
When it happens
Trigger: The creator.xiaohongshu.com note-manager DOM changed (different tab markup/selectors) after an XHS frontend update; the page rendered in a language other than Chinese so the 已发布 label doesn't match; the page didn't finish rendering within ROW_SETTLE_MS; a variant layout (A/B test) hides the tab.
Common situations: XHS shipping a UI redesign; account region/language settings rendering English labels; slow network making the tab render after the 3s settle window; A/B-tested admin layouts for some accounts.
Related errors
- xiaohongshu/delete-note: note ${noteId} row found but no del
- dianping ${contextHint} did not render expected data${sample
- Midjourney did not expose "${config.label}" for video ${jobI
- Failed to remove @${username} from list ${listId}: ${uiResul
- Could not open the reply composer.
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/5059f3ce3dd98567.
Report an issue: GitHub.