Skip to content

feat: remove the 24-hour cap on update rollout delays - #5043

Merged
liruifengv merged 3 commits into
mainfrom
feat/remove-rollout-delay-cap
Nov 18, 2026
Merged

liruifengv merged 3 commits into
mainfrom
feat/remove-rollout-delay-cap

Conversation

@liruifengv

@liruifengv liruifengv commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

The CLI's staged update rollout clamps every configured batch delay to 24 hours, so the publish pipeline cannot stage a release over multiple days even when it deliberately wants to. This PR makes the client fully trust the rollout plan published in latest.json by removing the hard cap. The publish-side validation is relaxed in a companion change in kimi-cli-cdn-sync (pushed directly to its main).

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

The change is a single point in the existing rollout evaluation:

 rolloutDelayForBucket(rollout, bucket)
   for each batch covering the bucket
-    return min(batch.delaySeconds, 24h)
+    return batch.delaySeconds
   if no batch covers the bucket
-    return 24h (MAX_ROLLOUT_DELAY_SECONDS)
+    return 24h (UNCOVERED_ROLLOUT_DELAY_SECONDS)

Configured delays are now honored exactly as published. The old constant survives only as the fallback for devices not covered by any batch (a plan whose percents sum below 100%), renamed to UNCOVERED_ROLLOUT_DELAY_SECONDS to match its remaining role — it is a default for incomplete plans, no longer a ceiling on configured values.

The publish-side counterpart (kimi-cli-cdn-sync update-latest.sh, already on its main) relaxes the pre-publish manifest check from 0..86400 to >= 0, so plans beyond 24 hours can actually be published.

Two edge cases surfaced in review are handled. The remainder fallback never undercuts the longest configured delay, so uncovered devices cannot update before a deliberately delayed batch. And the eligibility timestamp is built defensively: a configured delay beyond JavaScript's Date range yields eligibleAt: null (the device simply stays held, exactly what the config says) instead of throwing RangeError and silently skipping the whole update preflight.

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
Passive update timing when latest.json configures a batch delay above 24h clamped to 24h honored as published No one today: the publish pipeline has only ever shipped the standard 30%/0h, 30%/12h, 40%/24h plan or --full kimi upgrade updates immediately regardless of rollout
Delay for buckets not covered by any batch 24h max(24h, longest configured delay), so the remainder always stays the slowest cohort — —

Affected modules: apps/kimi-code/src/cli/update (rollout evaluation only; channel selection, install, and prompt flows untouched). Coverage in test/cli/update/rollout.test.ts: the cases that pinned the clamp now pin that long delays are honored end to end (rolloutDelayForBucket and isRolloutEligible), the remainder cases pin both the 24h default and the "remainder stays behind the longest configured delay" ordering, and a dedicated case pins that an out-of-range delay reports held with eligibleAt: null instead of throwing. 34/34 pass.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1b8d051

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T09:38:47.227367Z 1b8d051 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

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

commit: 1b8d051

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1280c80298

ℹ️ 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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 1b8d0511b2

ℹ️ 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 22d559b into main Nov 18, 2026
17 checks passed
@liruifengv
liruifengv deleted the feat/remove-rollout-delay-cap branch November 18, 2026 09:46
devin-ai-integration Bot added a commit to 7723qqq/kimi-code that referenced this pull request Nov 24, 2026
…end drift-allow

- bun scripts/upstream-ledger.mjs --refresh: 148 new pending rows covering
  the 2.7.0 tail and upstream/main.
- Mark MoonshotAI#5043/MoonshotAI#5037/MoonshotAI#5049 ported (26f22db, 0d20273, d61aacc) and
  MoonshotAI#5042 equivalent (multiline feedback editor already shipped, localized).
- Refresh MoonshotAI#4820 evidence: the machine-architecture blocker retired with the
  2.7.0 merge.
- drift-allow: add the missing translated/renamed upstream files (media.ts,
  node-local hostServices/rgLocator/runRg, executor validate.ts, remaining
  vitest configs) so upstream-drift stops flagging deliberate removals.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 25, 2026
The 2.7.0 merge resolution had kept the clamped rollout copy, so plan
delays beyond 24h were still capped and the compatibility alias survived
(MoonshotAI#5043). Restore the upstream behavior: covered buckets honor their delay,
uncovered buckets sit behind the longest configured delay with a 24h floor,
and the Date-range guard stays. Port the SSH address hint that mentions the
optional port suffix in both locales (MoonshotAI#5358) with its changeset.
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.

2 participants