{"record":{"id":"3e956eb38c93f1d6","repo":"jackwener/OpenCLI","slug":"weread-skill-message-required-skill-versi","errorCode":null,"errorMessage":"WeRead skill 需升级: ${message}. Required skill_version=${required}, current=${SKILL_VERSION}","messagePattern":"WeRead skill 需升级: (.+?)\\. Required skill_version=(.+?), current=(.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/weread-official/utils.js","lineNumber":124,"sourceCode":"            `weread-official ${apiName} HTTP ${response.status}`,\n            'Check WeRead gateway availability and that WEREAD_API_KEY is still valid.',\n        );\n    }\n\n    let payload;\n    try {\n        payload = await response.json();\n    }\n    catch (error) {\n        const detail = error instanceof Error ? error.message : String(error);\n        throw new CommandExecutionError(`weread-official ${apiName} returned invalid JSON`, detail);\n    }\n\n    if (payload && typeof payload === 'object' && payload.upgrade_info) {\n        const info = payload.upgrade_info;\n        const required = info?.required_version ?? info?.version ?? 'unknown';\n        const message = info?.message ?? 'WeRead skill version is outdated';\n        throw new CommandExecutionError(\n            `WeRead skill 需升级: ${message}. Required skill_version=${required}, current=${SKILL_VERSION}`,\n            'Pull the latest weread-skills.zip and bump SKILL_VERSION in clis/weread-official/utils.js.',\n        );\n    }\n\n    const errcode = Number(payload?.errcode ?? 0);\n    if (errcode !== 0) {\n        const errmsg = String(payload?.errmsg ?? 'unknown error');\n        if (AUTH_ERRCODES.has(errcode)) {\n            throw new AuthRequiredError(\n                WEREAD_DOMAIN,\n                `WEREAD_API_KEY rejected (errcode=${errcode}, ${errmsg}). Regenerate the key and re-export it.`,\n            );\n        }\n        throw new CommandExecutionError(\n            `weread-official ${apiName} returned errcode=${errcode}`,\n            errmsg,\n        );","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weread-official/utils.js#L106-L142","documentation":"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.","triggerScenarios":"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.","commonSituations":"WeRead shipping a mandatory skill upgrade; using an old copied skill folder while a newer version exists; pinning an old release in a deployment.","solutions":["Download the latest weread-skills.zip and replace the skill files.","Bump SKILL_VERSION in clis/weread-official/utils.js to the required version shown in the message.","Re-run the command after upgrading.","Check for skill update channels/announcements to anticipate future bumps."],"exampleFix":"// before (clis/weread-official/utils.js)\nexport const SKILL_VERSION = '1.0.0';\n// after (required_version from upgrade_info)\nexport const SKILL_VERSION = '1.2.0';","handlingStrategy":"try-catch","validationCode":"const cur = SKILL_VERSION; // compare against the version pinned by the skill distribution before bulk calls\nif (process.env.WEREAD_MIN_SKILL_VERSION && cur < process.env.WEREAD_MIN_SKILL_VERSION) throw new Error('Skill too old — update weread-skills.zip first');","typeGuard":"const isUpgradeNeeded = (e) => e instanceof CommandExecutionError && e.message.includes('需升级');","tryCatchPattern":"try {\n  return await callGateway(apiName, params);\n} catch (e) {\n  if (e instanceof CommandExecutionError && /skill_version|需升级/.test(e.message)) {\n    console.error('Update the skill: download latest weread-skills.zip, bump SKILL_VERSION in clis/weread-official/utils.js');\n    process.exitCode = 10; // distinct code for automation to trigger upgrade\n  }\n  throw e;\n}","preventionTips":["Re-download the skill package when the maintainer announces a version bump","Never hand-edit SKILL_VERSION without updating the rest of the package","Catch this error in automation and trigger an upgrade workflow","Pin the skill version centrally (env var) and check it at script start"],"tags":["versioning","upgrade","api-gateway"],"backgroundTag":"client-version-outdated","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}