Skip to content

chore: sync release 2026-10-30 back to main - #4557

Merged
liruifengv merged 4 commits into
mainfrom
chore/sync-release-2026-10-30-back-to-main
Oct 30, 2026
Merged

liruifengv merged 4 commits into
mainfrom
chore/sync-release-2026-10-30-back-to-main

Conversation

@kimi-agent-bot

@kimi-agent-bot kimi-agent-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

将 release/2026-10-30 的 CLI 2.4.1 补丁发布内容回同步到 main,同时保留 main 在分支之后合入的功能、重构与 Web 产物。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
内置工具、system prompt、Goal / Plan 提醒 main 的提示词与 #4538 请求架构 在保留 #4538 架构的同时带上线 2.4.1 的精简提示词 使用 TUI、print、desktop / web、VS Code、ACP、SDK 的会话 无;与已发布 2.4.1 行为对齐
Agent 单次 Read 输出 最多 500,000 字符 最多 100,000 字符或约 25,000 tokens,以先到者为准 读取大文件的 Agent 会话 在 config.toml 的 [read] 下设置 max_chars
main 的 Web 产物 #4542 的较新 bundle 不变,不用 release 旧 bundle 回退 kimi web 与内置 Web UI 用户 不需要
main 后续功能与重构 #4538 等 main 提交 保留;冲突只针对本次 release 触及的路径解决 main 后续功能的使用者 不需要
CLI 包版本与 changeset 2.4.0,三个发布 changeset 尚未消费 2.4.1,三个 changeset 已消费;VS Code 仍 0.8.4 后续版本 PR 与发版基准 不需要

验证:

  • pnpm typecheck 通过(含 packages build、CLI、VS Code、vis)。
  • pnpm lint 通过;仅有仓内既有 warnings。
  • agent-core-v2 定向 12 个测试文件:797 passed,重生成 12 处快照;其中 fullCompaction.test.ts 120 passed(pre-shrink 预算按精简后提示词调整为 80k,绝对 token 断言改为数值匹配),Read 96 passed,Bash 56 passed。
  • kap-server 全量:1442 passed / 2 failed;失败为既有 test/search/searchService.test.ts 两条基线问题(sync failure accounting、fingerprint cache),test/sessions.test.ts 91 passed。以本 PR CI 为最终验收。
  • git diff --check 通过;apps/kimi-code/dist-web、apps/vscode、pnpm-lock.yaml 均为零 diff。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. (更新并运行受影响的提示词、Read、Goal / Plan 快照与单元测试)
  • 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. (行为均来自已发布并审批的 2.4.1;Read 提供 max_chars 退路)
  • Ran gen-changesets skill, or this PR needs no changeset. (回同步已消费 changeset,无新增用户变化)
  • Ran gen-docs skill, or this PR needs no doc update. (Read 配置与中英工具文档随 fix(agent-core-v2): cap Read at about 25k tokens and trim file tool results #4553 回同步;changelog docs 已在 docs(changelog): sync 2.4.1 from apps/kimi-code/CHANGELOG.md #4556 合入)

7Sageer and others added 4 commits October 30, 2026 18:45
* chore(agent-core-v2): slim prompts and reminders

* fix(agent-core-v2): restore subagent authorization guidance

* chore(agent-core-v2): drop prompt wording assertion
…esults (#4553)

* fix(agent-core-v2): cap Read at about 25k tokens and trim file tool results

- Cap the max_chars a Read call can request at 100k characters (was
  500k) and drop the description sentence that told the model to request
  a larger budget for whole large files; the event log note now points
  to Next Read instead of a larger max_chars.
- Stop a page at about max_chars / 4 estimated tokens. The limit is
  applied while the page is assembled: drop whole lines, or cut a single
  long line by token weight, without re-reading the file. It rounds up,
  so pages of ASCII text never reach it and keep their exact character
  pagination. A tail read whose last line cannot fit returns the bounded
  forward recovery.
- Omit the Read status block when a call returns the whole file with
  nothing to report.
- On an incomplete page, point to Grep for a specific section instead of
  answering from that page alone.
- After a successful Edit or Write, tell the model it does not need to
  Read the file back.

* fix(agent-core-v2): reject named Read ranges that exceed the token limit

When a call names a range, with n_lines or a negative line_offset, and
those lines exceed the estimated token limit, return an error that says
how many lines fit and suggests the exact arguments, instead of a page
that silently covers only part of the range. Whole-file reads, reads
from an offset to the end, single-line requests, and column
continuations still page with Next Read.

* fix(agent-core-v2): keep character paging for named Read ranges

The named-range check ran before character trimming, so an ASCII range
longer than max_chars, whose status block pushed the page over both
limits, returned a range error instead of a page with Next Read. Run the
check only once the page fits max_chars, so it rejects a range only when
the token limit would cut it shorter than the character limit does.

* test(kap-server): raise max_chars in the paginated attachment read test

Every incomplete Read page now carries one more status sentence, so with
a 500-character budget and a long attachment path the status took about
490 characters and the read could not finish within the test's 80 pages.
@changeset-bot

changeset-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5454f27

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 Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T11:04:51.368680Z 5454f27 PR opened
ℹ️ 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 Oct 30, 2026

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

commit: 5454f27

@liruifengv
liruifengv merged commit cca9bae into main Oct 30, 2026
16 of 17 checks passed
@liruifengv
liruifengv deleted the chore/sync-release-2026-10-30-back-to-main branch October 30, 2026 11:03

@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: 5454f272c3

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

Comment on lines +128 to +132
const suggestion = {
path: page.request.args.path,
line_offset: page.fromTail ? page.rangeEnd - lines + 1 : page.rangeStart,
n_lines: lines,
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Carry max_chars into the suggested retry

When [read].max_chars is raised but default_max_chars remains lower, a named-range request can exceed the token limit only after explicitly requesting the larger max_chars. The suggested arguments are calculated using that larger effective budget but omit it, so retrying the exact JSON falls back to default_max_chars and can truncate the supposedly fitting range again. Include page.request.maxChars in the suggestion so the recovery works for independently configured defaults and maxima.

Useful? React with 👍 / 👎.

Comment on lines +177 to +179
agents_section:
agentsMd.length > 0 || options.readOnly !== true
? renderPrompt(PROJECT_INFORMATION_SECTION, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve nested AGENTS.md discovery for read-only profiles

When no AGENTS.md applies at the current working directory but scoped guides exist below it, this condition removes the entire Project information section from the explore and plan profiles, including the instruction to check subdirectories for more-specific guidance. A root-scoped Glob or Grep records only the search root as its access, so the dynamic discovery reminder does not necessarily find a guide beside a matched descendant; the read-only agent can then return analysis or a plan without applying that guide. Keep the discovery instruction for read-only profiles even when the initial agentsMd content is empty.

AGENTS.md reference: AGENTS.md:L119-L121

Useful? React with 👍 / 👎.

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.

4 participants