{"record":{"id":"060ec25107149d36","repo":"jackwener/OpenCLI","slug":"editing-form-did-not-appear-after-image-acquisitio","errorCode":null,"errorMessage":"Editing form did not appear after image acquisition. The page layout may have changed. Debug screenshot: /tmp/xhs_publish_form_debug.png","messagePattern":"Editing form did not appear after image acquisition\\. The page layout may have changed\\. Debug screenshot: /tmp/xhs_publish_form_debug\\.png","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/xiaohongshu/publish.js","lineNumber":1254,"sourceCode":"        if (isTextImage) {\n            // Drive 文字配图: type cards → 生成图片 → pick style → 下一步 → standard editor.\n            appliedCardStyle = await runTextImageFlow(page, cards, cardStyle);\n        }\n        else {\n            const upload = await uploadImages(page, absImagePaths);\n            if (!upload.ok) {\n                await page.screenshot({ path: '/tmp/xhs_publish_upload_debug.png' });\n                throw new CommandExecutionError(`Image injection failed: ${upload.error ?? 'unknown'}. ` +\n                    'Debug screenshot: /tmp/xhs_publish_upload_debug.png');\n            }\n            await page.wait({ time: UPLOAD_SETTLE_MS / 1_000 });\n            await waitForUploads(page);\n        }\n        // ── Step 3b: Wait for editor form to render ───────────────────────────────\n        const formReady = await waitForEditForm(page);\n        if (!formReady) {\n            await page.screenshot({ path: '/tmp/xhs_publish_form_debug.png' });\n            throw new CommandExecutionError('Editing form did not appear after image acquisition. The page layout may have changed. ' +\n                'Debug screenshot: /tmp/xhs_publish_form_debug.png');\n        }\n        if (isTextImage) {\n            await assertComposerMediaCount(page, cards.length, '文字配图 generated images');\n        }\n        // ── Step 3c: In text-image mode, optionally append uploaded images ────────\n        if (isTextImage && absImagePaths.length > 0) {\n            const upload = await uploadImages(page, absImagePaths);\n            if (!upload.ok) {\n                await page.screenshot({ path: '/tmp/xhs_publish_append_debug.png' });\n                throw new CommandExecutionError(`Appending images failed: ${upload.error ?? 'unknown'}. ` +\n                    'Debug screenshot: /tmp/xhs_publish_append_debug.png');\n            }\n            await page.wait({ time: UPLOAD_SETTLE_MS / 1_000 });\n            await waitForUploads(page);\n            await assertComposerMediaCount(page, cards.length + absImagePaths.length, '文字配图 appended images');\n        }\n        // ── Step 4: Fill title ─────────────────────────────────────────────────────","sourceCodeStart":1236,"sourceCodeEnd":1272,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xiaohongshu/publish.js#L1236-L1272","documentation":"After images are acquired/uploaded, the CLI waits for the note editor form (title/description fields) via waitForEditForm. If the form never appears, the page structure no longer matches expectations and the publish flow cannot continue, so it aborts with a debug screenshot.","triggerScenarios":"waitForEditForm returns false after upload — the editor form did not render within its wait window after successful image injection.","commonSituations":"Xiaohongshu redesigned the editor so the form selectors no longer match, a previous step silently failed leaving a modal/error dialog open, slow network kept the form from rendering in time, or the session was downgraded mid-flow.","solutions":["Inspect /tmp/xhs_publish_form_debug.png to see what the page actually shows.","Retry — slow rendering can exceed the wait timeout.","Check the screenshot for login/verification dialogs and re-capture login if present.","Update the CLI or report the issue if the editor DOM changed."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await publish(opts);\n} catch (e) {\n  if (String(e.message).includes('Editing form did not appear')) {\n    await sleep(5000); // allow slow render\n    return publish(opts);\n  }\n  throw e;\n}","preventionTips":["Run on a stable network; slow loads are the most common benign cause.","Inspect /tmp/xhs_publish_form_debug.png before retrying to spot dialogs or login walls.","Keep the CLI current — editor DOM changes break form detection.","Avoid concurrent xiaohongshu sessions that could trigger interstitials."],"tags":["dom-structure","timeout","browser-automation","xiaohongshu"],"backgroundTag":"page-layout-changed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}