jackwener/OpenCLI · error · CommandExecutionError

WeRead skill 需升级: ${message}. Required skill_version=${requi

Error message

WeRead skill 需升级: ${message}. Required skill_version=${required}, current=${SKILL_VERSION}

What it means

The gateway returned an upgrade_info payload indicating the client skill_version is outdated and must be upgraded before further calls. callGateway throws CommandExecutionError comparing required vs current SKILL_VERSION.

Source

Thrown at clis/weread-official/utils.js:124

            `weread-official ${apiName} HTTP ${response.status}`,
            'Check WeRead gateway availability and that WEREAD_API_KEY is still valid.',
        );
    }

    let payload;
    try {
        payload = await response.json();
    }
    catch (error) {
        const detail = error instanceof Error ? error.message : String(error);
        throw new CommandExecutionError(`weread-official ${apiName} returned invalid JSON`, detail);
    }

    if (payload && typeof payload === 'object' && payload.upgrade_info) {
        const info = payload.upgrade_info;
        const required = info?.required_version ?? info?.version ?? 'unknown';
        const message = info?.message ?? 'WeRead skill version is outdated';
        throw new CommandExecutionError(
            `WeRead skill 需升级: ${message}. Required skill_version=${required}, current=${SKILL_VERSION}`,
            'Pull the latest weread-skills.zip and bump SKILL_VERSION in clis/weread-official/utils.js.',
        );
    }

    const errcode = Number(payload?.errcode ?? 0);
    if (errcode !== 0) {
        const errmsg = String(payload?.errmsg ?? 'unknown error');
        if (AUTH_ERRCODES.has(errcode)) {
            throw new AuthRequiredError(
                WEREAD_DOMAIN,
                `WEREAD_API_KEY rejected (errcode=${errcode}, ${errmsg}). Regenerate the key and re-export it.`,
            );
        }
        throw new CommandExecutionError(
            `weread-official ${apiName} returned errcode=${errcode}`,
            errmsg,
        );

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Download the latest weread-skills.zip and replace the skill files.
  2. Bump SKILL_VERSION in clis/weread-official/utils.js to the required version shown in the message.
  3. Re-run the command after upgrading.
  4. Check for skill update channels/announcements to anticipate future bumps.

Example fix

// before (clis/weread-official/utils.js)
export const SKILL_VERSION = '1.0.0';
// after (required_version from upgrade_info)
export const SKILL_VERSION = '1.2.0';
Defensive patterns

Strategy: try-catch

Validate before calling

const cur = SKILL_VERSION; // compare against the version pinned by the skill distribution before bulk calls
if (process.env.WEREAD_MIN_SKILL_VERSION && cur < process.env.WEREAD_MIN_SKILL_VERSION) throw new Error('Skill too old — update weread-skills.zip first');

Type guard

const isUpgradeNeeded = (e) => e instanceof CommandExecutionError && e.message.includes('需升级');

Try / catch

try {
  return await callGateway(apiName, params);
} catch (e) {
  if (e instanceof CommandExecutionError && /skill_version|需升级/.test(e.message)) {
    console.error('Update the skill: download latest weread-skills.zip, bump SKILL_VERSION in clis/weread-official/utils.js');
    process.exitCode = 10; // distinct code for automation to trigger upgrade
  }
  throw e;
}

Prevention

When it happens

Trigger: Server-side minimum skill_version was bumped and the installed weread-official skill still reports the old SKILL_VERSION; a stale downloaded weread-skills.zip; partially edited utils.js after a manual update.

Common situations: WeRead shipping a mandatory skill upgrade; using an old copied skill folder while a newer version exists; pinning an old release in a deployment.

Related errors


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