{"record":{"id":"1d9d75d30c845335","repo":"jackwener/OpenCLI","slug":"composer-fill-was-not-verified","errorCode":null,"errorMessage":"composer fill was not verified","messagePattern":"composer fill was not verified","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clis/midjourney/generate.js","lineNumber":193,"sourceCode":"      await uploadReferencesToSlot(page, localImageRefs, 'image');\n      await uploadReferencesToSlot(page, localStyleRefs, 'style');\n      await uploadReferencesToSlot(page, localOmniRefs, 'omni');\n    }\n    await closeImagePanel(page);\n\n    let captureReady = false;\n    if (typeof page.installInterceptor === 'function' && typeof page.getInterceptedRequests === 'function') {\n      try {\n        await page.installInterceptor('/api/submit-jobs');\n        await page.getInterceptedRequests();\n        captureReady = true;\n      } catch {}\n    }\n\n    const submittedAt = Date.now();\n    try {\n      const filled = await page.fillText(COMPOSER_SELECTOR, effectivePrompt);\n      if (!filled?.filled || !filled?.verified) throw new Error('composer fill was not verified');\n      await page.pressKey('Enter');\n    } catch (error) {\n      throw new CommandExecutionError(`Could not submit the Midjourney prompt: ${error instanceof Error ? error.message : String(error)}`);\n    }\n\n    const remainingForSubmission = Math.floor(timeout - (Date.now() - commandStartedAt) / 1000);\n    if (remainingForSubmission < 1) throw new TimeoutError('Midjourney job submission', timeout);\n    const submitTimeout = Math.min(remainingForSubmission, 75);\n    let jobIds = [];\n    if (captureReady && typeof page.waitForCapture === 'function') {\n      try {\n        await page.waitForCapture(Math.min(submitTimeout, 20));\n        jobIds = submittedJobIdsFromCaptures(await page.getInterceptedRequests(), plan.repeat, baselineIds);\n      } catch (error) {\n        if (error instanceof CommandExecutionError) throw error;\n      }\n    }\n    if (!jobIds.length) {","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/midjourney/generate.js#L175-L211","documentation":"After typing the prompt into the composer, the CLI verifies the fill actually landed: page.fillText returns {filled, verified}; if either is falsy the code throws 'composer fill was not verified', which is immediately wrapped into the 'Could not submit the Midjourney prompt' CommandExecutionError (index 2618). This guard prevents submitting an empty or partially-typed prompt and silently charging GPU minutes for the wrong job.","triggerScenarios":"page.fillText(COMPOSER_SELECTOR, effectivePrompt) returns null/undefined (element detached mid-fill), an object with filled:false (could not set the value), or verified:false (the DOM value did not match after write) — caused by the composer unmounting, a modal/overlay stealing focus, a React re-render wiping the textarea, or the selector matching a stale node.","commonSituations":"Midjourney page re-rendered (settings panel toggle, image uploads finishing) while filling; slow/rate-limited page where the composer was replaced; an announcement modal or onboarding overlay intercepting the textarea; very long prompts with parameters being truncated by client-side normalization.","solutions":["Re-run the command; transient re-render races usually succeed on retry","Dismiss any modals/overlays on the Imagine page and ensure the composer is idle before submitting","Avoid editing the composer manually while the command runs in the background browser","If it reproduces every time, check for a Midjourney UI change and update opencli"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Cannot be pre-validated externally — it is a post-fill verification.\n// Mitigation: ensure the composer is idle before submission:\nawait page.wait({ selector: COMPOSER_SELECTOR, timeout: 12 });\nawait clearImagePrompts(page);   // dispose of leftover staged content that may re-render","typeGuard":"function isVerifiedFill(result) {\n  return Boolean(result && result.filled === true && result.verified === true);\n}","tryCatchPattern":"try {\n  await generate(prompt, opts);\n} catch (e) {\n  if (/composer fill was not verified|Could not submit the Midjourney prompt/.test(e.message)) {\n    await sleep(2000);\n    await generate(prompt, opts);  // transient re-render races usually clear\n  } else throw e;\n}","preventionTips":["Don't interact with the browser window while the command runs in background mode","Dismiss modals/overlays on the Imagine page before running generate","Keep reference uploads small to reduce page churn during the fill window","Retry once after a short delay — the most common cause is a React re-render race"],"tags":["browser-automation","midjourney","verification","race-condition"],"backgroundTag":"dom-fill-not-verified","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}