Skip to content

fix(cli): give the interactive update check a longer CDN timeout - #3307

Merged
liruifengv merged 4 commits into
MoonshotAI:mainfrom
kimi-agent-bot:fix/interactive-update-check-timeout
Aug 28, 2026
Merged

fix(cli): give the interactive update check a longer CDN timeout#3307
liruifengv merged 4 commits into
MoonshotAI:mainfrom
kimi-agent-bot:fix/interactive-update-check-timeout

Conversation

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator

Related Issue

Resolve #3306

Problem

kimi update intermittently fails with error: 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-request timeoutMs, defaulting to the existing 3-second background budget — all background refresh paths (startup refresh, prompt pre-refresh) are unchanged.
  • cli/update/refresh.ts: refreshUpdateCache accepts an optional timeoutMs dep that is threaded into the default CDN fetch (ignored when fetchLatest is injected).
  • cli/sub/upgrade.ts: the interactive kimi update/kimi upgrade command passes INTERACTIVE_UPDATE_CHECK_TIMEOUT_MS (10s, in constant/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.
  • Tests: custom-timeout behavior in cdn.test.ts (asserts the 3s default would have rejected before the custom budget fires) and timeoutMs threading in refresh.test.ts.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: the issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

`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-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: be7bc7b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@be7bc7b
npx https://pkg.pr.new/@moonshot-ai/kimi-code@be7bc7b

commit: be7bc7b

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 4810069ccd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 1aed6e57d9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 393d386068

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: be7bc7b9d3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@liruifengv
liruifengv merged commit 0310f22 into MoonshotAI:main Aug 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kimi update intermittently fails with "failed to check for updates: This operation was aborted" (3s CDN timeout shared with background checks)

2 participants