cmd update reports a network failure on a single transient registry miss
維護者通常 1 天內回覆
@Gurugokul05 已經在處理了。
開始於 2026年10月22日。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 62/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript, node.js
- 領域
- backend, cli, observability
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- 沒有語言資料
- 星號
- 4.2k
- 分支
- 377
- 平均合併
- 1 天 17 分鐘
- 30 天內合併 PR
- 7
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CommandCodeAI/command-code 的其他 Issue
-
Provider /v1/messages rejects role:"system" inside messages[] — Claude Code ≥ 2.1.154 incompatible未關閉
難度 2/5 1-3 小時 新手友好度 75/100
CommandCodeAI/command-code#1085 ·
維護者通常 1 天內回覆
-
Feature request: auto-reconnect remote control (/rc) after restart可能已有人在做 @aliarain 於 20 天前認領。 未關閉p2
難度 2/5 1-3 小時 新手友好度 85/100
CommandCodeAI/command-code#992 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#933 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#855 ·
維護者通常 1 天內回覆
-
grep tool passes empty file type to ripgrep可能已有人在做 @ahmadbilaldev 於 19 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#655 · 1 則留言 ·
維護者通常 1 天內回覆
查看 CommandCodeAI/command-code 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 85/100
-
難度 2/5 1-3 小時 新手友好度 78/100
UKGovernmentBEIS/inspect_ai#6512 ·
維護者通常 1 天內回覆
-
area/c++ area/core kind/bug-report
難度 2/5 1-3 小時 新手友好度 78/100
tensorflow/quantum#1140 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 68/100
Kav-K/GPTDiscord#501 ·
維護者通常 1 天內回覆