BigPizzaV3/CodexPlusPlus · error
Invalid version tag
Error message
Invalid version tag: {value} What it means
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`.
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.
Example fix
// before
is_newer_version("latest", "v1.2.3"); // bails
// after
let tag = resolve_tag("latest"); // e.g. -> "v1.3.0"
if tag.chars().any(|c| c.is_ascii_digit()) {
is_newer_version(&tag, "v1.2.3");
} Defensive patterns
Strategy: validation
Validate before calling
fn is_comparable_tag(tag: &str) -> bool {
tag.trim_start_matches(|c: char| !c.is_ascii_digit()).chars().next().map_or(false, |c| c.is_ascii_digit())
}
if is_comparable_tag(remote_tag) {
let newer = is_newer_version(remote_tag, local_tag)?;
} Try / catch
let newer = match is_newer_version(&remote, &local) {
Ok(n) => n,
Err(e) if e.to_string().contains("Invalid version tag") => { log::warn!("skipping non-numeric tag {remote}"); false }
Err(e) => return Err(e),
}; Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- 不支持此分享的数据格式。
- browser WebSocket URL has no Browser ID
- 当前 Codex 版本的 API 适配器不兼容,请更新对话脉络脚本
- 打开 DMG 失败:
- 当前平台不支持启动安装包
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/4d0a289b586fdac4.
Report an issue: GitHub.
Appendix: source
Thrown at crates/codex-plus-core/src/update.rs:56
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct UpdateInstall {
pub release: Release,
pub installer_path: PathBuf,
pub launched: bool,
}
pub fn parse_version_tag(value: &str) -> anyhow::Result<Vec<u64>> {
let normalized = value.trim().trim_start_matches(['v', 'V']);
let mut digits = String::new();
for ch in normalized.chars() {
if ch.is_ascii_digit() || ch == '.' {
digits.push(ch);
} else {
break;
}
}
if digits.is_empty() {
anyhow::bail!("Invalid version tag: {value}");
}
digits
.split('.')
.map(|part| part.parse::<u64>().map_err(Into::into))
.collect()
}
pub fn is_newer_version(candidate: &str, current: &str) -> anyhow::Result<bool> {
let mut left = parse_version_tag(candidate)?;
let mut right = parse_version_tag(current)?;
let len = left.len().max(right.len());
left.resize(len, 0);
right.resize(len, 0);
Ok(left > right)
}
pub fn release_from_github_payload(payload: &Value) -> anyhow::Result<Release> {
let version = payloadView on GitHub (pinned to b1ed92e5e4)