{"record":{"id":"4d0a289b586fdac4","repo":"BigPizzaV3/CodexPlusPlus","slug":"invalid-version-tag-value","errorCode":null,"errorMessage":"Invalid version tag: {value}","messagePattern":"Invalid version tag: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/update.rs","lineNumber":56,"sourceCode":"#[derive(Debug, Clone, PartialEq, Eq, Serialize)]\npub struct UpdateInstall {\n    pub release: Release,\n    pub installer_path: PathBuf,\n    pub launched: bool,\n}\n\npub fn parse_version_tag(value: &str) -> anyhow::Result<Vec<u64>> {\n    let normalized = value.trim().trim_start_matches(['v', 'V']);\n    let mut digits = String::new();\n    for ch in normalized.chars() {\n        if ch.is_ascii_digit() || ch == '.' {\n            digits.push(ch);\n        } else {\n            break;\n        }\n    }\n    if digits.is_empty() {\n        anyhow::bail!(\"Invalid version tag: {value}\");\n    }\n    digits\n        .split('.')\n        .map(|part| part.parse::<u64>().map_err(Into::into))\n        .collect()\n}\n\npub fn is_newer_version(candidate: &str, current: &str) -> anyhow::Result<bool> {\n    let mut left = parse_version_tag(candidate)?;\n    let mut right = parse_version_tag(current)?;\n    let len = left.len().max(right.len());\n    left.resize(len, 0);\n    right.resize(len, 0);\n    Ok(left > right)\n}\n\npub fn release_from_github_payload(payload: &Value) -> anyhow::Result<Release> {\n    let version = payload","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/update.rs#L38-L74","documentation":"parse_version_tag scans a git-style version tag (e.g. `v1.2.3`, `codex-rs-v0.4.0`) for its leading digits after the prefix. If it collects no digits at all — the tag contains no numeric component — it cannot derive a comparable version and bails with `Invalid version tag`.","triggerScenarios":"Calling is_newer_version (which calls parse_version_tag) with tags like `latest`, `nightly`, `beta`, `release` or a truncated/empty tag from the update source. Any tag where scanning stops before pushing a single digit.","commonSituations":"A GitHub release published with a non-semver tag name; a typo'd tag like `version-` with no number; comparing against the literal string `latest` fetched from a registry; renaming release tags to a new convention that drops numbers.","solutions":["Ensure release tags follow the expected `<prefix>-v<digits>[.digits...]` convention, e.g. `v0.5.1`.","Check the remote tag list (`git ls-remote --tags`) and fix or delete malformed tags.","Guard the comparison: skip update-check when the tag has no numeric part instead of treating it as newer.","If comparing against `latest`, resolve it to the concrete tag first."],"exampleFix":"// before\nis_newer_version(\"latest\", \"v1.2.3\"); // bails\n// after\nlet tag = resolve_tag(\"latest\"); // e.g. -> \"v1.3.0\"\nif tag.chars().any(|c| c.is_ascii_digit()) {\n    is_newer_version(&tag, \"v1.2.3\");\n}","handlingStrategy":"validation","validationCode":"fn is_comparable_tag(tag: &str) -> bool {\n    tag.trim_start_matches(|c: char| !c.is_ascii_digit()).chars().next().map_or(false, |c| c.is_ascii_digit())\n}\nif is_comparable_tag(remote_tag) {\n    let newer = is_newer_version(remote_tag, local_tag)?;\n}","typeGuard":null,"tryCatchPattern":"let newer = match is_newer_version(&remote, &local) {\n    Ok(n) => n,\n    Err(e) if e.to_string().contains(\"Invalid version tag\") => { log::warn!(\"skipping non-numeric tag {remote}\"); false }\n    Err(e) => return Err(e),\n};","preventionTips":["Enforce `v<major>.<minor>.patch` tag naming in your release CI.","Resolve moving tags (`latest`, `nightly`) to concrete versions before comparing.","Add a unit test for parse_version_tag covering non-numeric tags."],"tags":["versioning","parsing","update","release"],"backgroundTag":"invalid-argument-format","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}