cmd update reports a network failure on a single transient registry miss
I maintainer di solito rispondono entro 1 giorno
@Gurugokul05 ci sta già lavorando.
Dal 22/10/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, node.js
- Ambito
- backend, cli, observability
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 4.2k
- Fork
- 377
- Merge medio
- 1g 17m
- PR unite (30g)
- 7
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CommandCodeAI/command-code
-
Provider /v1/messages rejects role:"system" inside messages[] — Claude Code ≥ 2.1.154 incompatibleAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
CommandCodeAI/command-code#1085 ·
I maintainer di solito rispondono entro 1 giorno
-
Feature request: auto-reconnect remote control (/rc) after restartForse già presa @aliarain l’ha presa 20 giorni fa. Apertap2
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
CommandCodeAI/command-code#992 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CommandCodeAI/command-code#933 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CommandCodeAI/command-code#855 ·
I maintainer di solito rispondono entro 1 giorno
-
grep tool passes empty file type to ripgrepForse già presa @ahmadbilaldev l’ha presa 19 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CommandCodeAI/command-code#655 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di CommandCodeAI/command-code
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
UKGovernmentBEIS/inspect_ai#6512 ·
I maintainer di solito rispondono entro 1 giorno
-
area/c++ area/core kind/bug-report
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tensorflow/quantum#1140 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Kav-K/GPTDiscord#501 ·
I maintainer di solito rispondono entro 1 giorno