jackwener/OpenCLI · error · CommandExecutionError

Xiaohongshu account-scoped filter was unavailable (${detail}

Error message

Xiaohongshu account-scoped filter was unavailable (${detail}); verify login and account access.

What it means

When the filter-application script reports status 'capability', requireFilterApplication throws this CommandExecutionError indicating an account-scoped filter was unavailable. Some filters depend on account-level features or entitlements that the current logged-in account does not have, and the page could not expose the filter control.

Source

Thrown at clis/xiaohongshu/search.js:516

    const result = unwrapEvaluateResult(payload);
    if (!result || typeof result !== 'object' || Array.isArray(result) || typeof result.status !== 'string') {
        throw new CommandExecutionError('Unexpected Xiaohongshu search filter result shape.');
    }
    if (result.status === 'ok') {
        return;
    }
    const detail = typeof result.detail === 'string' ? result.detail : 'unknown';
    if (result.status === 'auth') {
        throw new AuthRequiredError('www.xiaohongshu.com', 'Xiaohongshu search filters require a logged-in browser session');
    }
    if (result.status === 'timeout') {
        throw new TimeoutError(`xiaohongshu search filter ${detail}`, FILTER_SETTLE_SECONDS);
    }
    if (result.status === 'location') {
        throw new CommandExecutionError(`Xiaohongshu location filter was not applied (${detail}); enable browser geolocation permission.`);
    }
    if (result.status === 'capability') {
        throw new CommandExecutionError(`Xiaohongshu account-scoped filter was unavailable (${detail}); verify login and account access.`);
    }
    if (result.status === 'inactive') {
        throw new CommandExecutionError(`Xiaohongshu search filter chip did not become active (${detail}).`);
    }
    throw new CommandExecutionError(`Xiaohongshu search filter layout did not match the expected visible panel (${detail}).`);
}
/**
 * Build a "scroll until enough or plateaued" IIFE used in place of a fixed
 * `autoScroll({ times: N })`. Xiaohongshu's search results page lazy-loads
 * ~5-7 notes per scroll, so the previous `times: 2` capped extraction at
 * ~13 items regardless of `--limit` (see #1471). This helper drives scrolls
 * dynamically:
 *
 *   - count visible `section.note-item` rows (excluding related-search
 *     `.query-note-item` rows)
 *   - if count >= targetCount → break (got enough)
 *   - if two consecutive scrolls add no new rows → break (DOM plateaued,
 *     no more lazy-load available)

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the filter appears manually when logged into the same account in a normal browser; if not, the account lacks it
  2. Try a different/fully-featured account or a different region
  3. Remove the account-scoped filter from the search arguments and rely on filters the account supports
  4. If Xiaohongshu removed the feature, stop using the filter and update SEARCH_FILTERS accordingly

Example fix

// before
await search({ query: 'coffee', filters: { advanced: 'creator' } }); // account lacks this facet
// after
try {
  await search({ query: 'coffee', filters: { advanced: 'creator' } });
} catch (e) {
  if (e.message.includes('account-scoped filter was unavailable')) {
    return search({ query: 'coffee' }); // degrade gracefully without the filter
  }
  throw e;
}
Defensive patterns

Strategy: fallback

Try / catch

try {
  await collectSearchHarvest(query, { ...filters, accountScoped: 'x' });
} catch (e) {
  if (e.message.includes('account-scoped filter was unavailable')) {
    console.warn('account lacks this filter; retrying without it');
    return collectSearchHarvest(query, filters);
  }
  throw e;
}

Prevention

When it happens

Trigger: The in-page script returns {status:'capability', detail:...} when a filter option is missing from the rendered panel despite being requested — the logged-in account lacks the feature, the filter is region/experiment-gated, or the account type (e.g. unverified) cannot use it.

Common situations: Newly registered or restricted accounts lacking advanced search facets; A/B experiments where the filter UI isn't rendered for the account; region-locked filters; requesting a filter option that exists in code but is no longer offered to the account.

Related errors


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