fix(cli): give the interactive update check a longer CDN timeout - #3307
Conversation
`kimi update` shared the 3-second CDN fetch budget sized for passive background checks. Every CLI invocation is a fresh process paying full DNS+TCP+TLS setup, so a slow connection to the CDN intermittently aborted the interactive check with a raw "This operation was aborted". Thread a per-request timeout through the CDN fetch helpers and refreshUpdateCache; the interactive upgrade command now passes a 10 second budget (INTERACTIVE_UPDATE_CHECK_TIMEOUT_MS) while all background refresh paths keep the 3-second default.
🦋 Changeset detectedLatest commit: be7bc7b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Related Issue
Resolve #3306
Problem
kimi updateintermittently fails witherror: failed to check for updates: This operation was aborted. The interactive command shares the 3-second CDN fetch timeout that is sized for passive background checks: every CLI invocation is a fresh process paying full DNS+TCP+TLS setup, so a slow-but-working connection intermittently blows the budget and undici's raw AbortError message is printed verbatim. See linked issue for the full analysis.What changed
cli/update/cdn.ts: the fetch helpers (fetchLatestFromCdn,fetchLatestVersionFromCdn, manifest fetch) take a per-requesttimeoutMs, defaulting to the existing 3-second background budget — all background refresh paths (startup refresh, prompt pre-refresh) are unchanged.cli/update/refresh.ts:refreshUpdateCacheaccepts an optionaltimeoutMsdep that is threaded into the default CDN fetch (ignored whenfetchLatestis injected).cli/sub/upgrade.ts: the interactivekimi update/kimi upgradecommand passesINTERACTIVE_UPDATE_CHECK_TIMEOUT_MS(10s, inconstant/app.ts). A user who explicitly asked to update is waiting on the result anyway, so a longer budget costs nothing and absorbs slow connection setup.cdn.test.ts(asserts the 3s default would have rejected before the custom budget fires) andtimeoutMsthreading inrefresh.test.ts.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.