cmd update reports a network failure on a single transient registry miss
Les mainteneurs répondent en général sous 1 jour
@Gurugokul05 y travaille déjà.
Depuis le 22/10/2026.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 62/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- javascript, node.js
- Domaine
- backend, cli, observability
Piste de recherche
Start by locating fetchVersions() and buildCliUpdateCheckOutcome in the CLI source corresponding to dist/cli.mjs, then trace how the updater log is written. Reproduce the single failed npm view command-code versions --json check and inspect how its error is caught and normalized. Done when transient failures retry up to three times with short backoff, the final underlying error is shown and logged, and a successful retry reports the update status.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
cmd update (cmdc update on Windows) prints a network failure when one registry read misses, then the same command succeeds immediately. The check has no retry, and the catch hides the real error.
Transcript
Windows, Git Bash, [email protected]. No network change between the two runs.
$ cmdc update
✖ Failed to check for updates
Please check your internet connection or try again later.
$ cmdc update
✔ Up to date (1.84.0)
npm latest was 1.84.0 at the time, so the second run was a true up-to-date, not an install.
Check path (from dist/cli.mjs of 1.84.0)
buildCliUpdateCheckOutcome maps a null updateInfo to kind check-failed, spinner fail, message Failed to check for updates, detail Please check your internet connection or try again later. An up-to-date result is spinner succeed with Up to date (${currentVersion}).
updateInfo is null only when fetchVersions() returns null:
async function checkForUpdateAvailable() {
const versions = await fetchVersions();
if (!versions) return null;
}
async function fetchVersions() {
try {
const { stdout } = await execAsync(YP, {
encoding: "utf-8",
timeout: 5000,
env: { ...process.env, NODE_NO_WARNINGS: "1" }
});
return normalizeVersionsResponse(JSON.parse(stdout));
} catch {
return null;
}
}
execAsync is util.promisify(child_process.exec). YP is `npm view ${zP} versions --json` with zP = "command-code".
So the check is one npm view command-code versions --json, 5000ms, through a shell. Any timeout, non-zero exit, or non-JSON stdout becomes null. normalizeVersionsResponse also returns null when any entry is not a valid semver, so a registry warning on stdout fails the same way as a dead network.
There is no retry.
Why this is not "no internet"
~/.commandcode/logs/command.logrecordsStarting async update checkand never records the failure.~/.commandcode/updates.jsonstoreslastCheckedAtandpendingonly. A failed check leaves no cause.- npm cache logs from the same evening show
GET https://registry.npmjs.org/command-codereturning 200 in 130-287ms. - No proxy, VPN, or custom registry is configured.
~/.npmrconly setsprefixandallow-scripts.
Ask
- Retry a failed registry read (3 tries, short backoff) before printing the failure.
- Print the underlying error (timeout, DNS, HTTP status, npm exit code), not only "check your internet".
- Write that error to the updater log.
Environment
- OS: Windows, Git Bash
- Package:
[email protected](npm global,%APPDATA%\npm) - Command:
cmdc update
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 4.2k
- Forks
- 377
- Merge moyen
- 1 j 17 min
- PR mergées (30 j)
- 7
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de CommandCodeAI/command-code
-
Provider /v1/messages rejects role:"system" inside messages[] — Claude Code ≥ 2.1.154 incompatibleOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
CommandCodeAI/command-code#1085 ·
Les mainteneurs répondent en général sous 1 jour
-
Feature request: auto-reconnect remote control (/rc) after restartPeut-être pris @aliarain l’a pris il y a 20 jours. Ouvertep2
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
CommandCodeAI/command-code#992 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
CommandCodeAI/command-code#933 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
CommandCodeAI/command-code#855 ·
Les mainteneurs répondent en général sous 1 jour
-
grep tool passes empty file type to ripgrepPeut-être pris @ahmadbilaldev l’a pris il y a 19 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
CommandCodeAI/command-code#655 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de CommandCodeAI/command-code
Issues similaires
-
processNextTick leaks failure state between callbacks queued on the same promise in one tickOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
UKGovernmentBEIS/inspect_ai#6512 ·
Les mainteneurs répondent en général sous 1 jour
-
area/c++ area/core kind/bug-report
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
tensorflow/quantum#1140 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 68/100
Kav-K/GPTDiscord#501 ·
Les mainteneurs répondent en général sous 1 jour