jackwener/OpenCLI · error · CommandExecutionError

点击草稿按钮失败: creation-id-missing

Error message

点击草稿按钮失败: creation-id-missing

What it means

After clicking '暂存离开', clickSaveDraft walks the React fiber tree of the title input to read props.creation_id. If the click succeeded but no creation_id string was found on any fiber ancestor, it throws this CommandExecutionError with reason 'creation-id-missing'.

Source

Thrown at clis/douyin/draft.js:265

        stopPropagation() {},
        nativeEvent: null,
        target: btn,
        currentTarget: btn,
      });
    } else {
      btn.click();
    }
    return {
      ok: true,
      text: (btn.textContent || '').trim(),
      creationId,
    };
  }`));
    if (!result?.ok) {
        throw new CommandExecutionError(`点击草稿按钮失败: ${result?.reason || 'unknown'}`);
    }
    if (!result.creationId) {
        throw new CommandExecutionError('点击草稿按钮失败: creation-id-missing');
    }
    return {
        text: result.text || '暂存离开',
        creationId: result.creationId,
    };
}
/**
 * Wait until creator center shows the resumable-draft prompt after saving.
 */
async function waitForDraftResult(page, creationId) {
    let lastState = { href: '', bodyText: '' };
    for (let attempt = 0; attempt < 20; attempt += 1) {
        lastState = (await page.evaluate(`() => ({
      href: location.href,
      bodyText: document.body?.innerText || ''
    })`));
        if (lastState.href.includes('/creator-micro/content/upload')
            && /继续编辑/.test(lastState.bodyText)) {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry with a slightly longer delay before saving (the id may not be assigned yet) — e.g. add a wait before clickSaveDraft
  2. Check whether creation_id now appears in the page URL or global store; extract from there instead of the fiber walk
  3. Update the fiber key prefix ('__reactFiber$') in clis/douyin/draft.js:223 if React internals changed

Example fix

// before: only fiber props
if (typeof props?.creation_id === 'string' && props.creation_id) return props.creation_id;
// after: fall back to URL
const fromUrl = new URLSearchParams(location.search).get('creation_id');
return props?.creation_id || fromUrl || '';
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const r = await opencli.douyin.draft({ video, title });
} catch (e) {
  if (e.message.includes('creation-id-missing')) {
    // retry with a longer pre-save delay so the server assigns creation_id
  }
}

Prevention

When it happens

Trigger: Douyin moved creation_id off React fiber props (different state management, e.g. redux/store or URL only), the upload hadn't been assigned an id yet when saving very fast, or the title input's fiber root no longer carries the prop.

Common situations: Douyin frontend refactor changing where creation_id lives; saving immediately after upload before server assigns the id; internal React version change altering fiber key names ('__reactFiber$' prefix change).

Related errors


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