Repository navigation
fix: clarify wire version upgrade guidance - #4662
Merged
Merged
Conversation
Simplify the public upgrade error without exposing wire protocol versions. Preserve reader versions in API error details and CLI/TUI diagnostic logs.
🦋 Changeset detectedLatest commit: e53670d 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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
7Sageer
approved these changes
Nov 4, 2026
7723qqq
pushed a commit
to 7723qqq/kimi-code
that referenced
this pull request
Nov 4, 2026
…target MoonshotAI#4638 lands in four slices: core enforcement (4d49fcb), the kap-server mapping and route declarations (8988dea), search skipping an unreadable wire (1a34ae1), and the SDK entry with a regenerated manifest (65a6412). MoonshotAI#4662 stays pending rather than closed: its reworded message has a site now, but it also lands on the full route-declaration set, and four routes here (environment, interactions, sessionRating, tools) carry no `WIRE_VERSION_TOO_LOW` declaration because their error maps use anchors this fork does not have. Ledger: closed 40 -> 43, remaining 56.
7723qqq
pushed a commit
to 7723qqq/kimi-code
that referenced
this pull request
Nov 4, 2026
Port of upstream 8fc5e22 (MoonshotAI#4662). A session written by a newer reader failed with `This wire.jsonl requires reader protocol 1.5; current Kimi Code supports 1.4`, which tells the user nothing actionable and exposes an internal protocol number. The thrown error and the public error action now say that the session needs a newer Kimi Code and to upgrade to the latest version, while `minReaderVersion`/`readerVersion` stay in `details` — which is why `wire.version_too_low` joins `PUBLIC_DETAIL_CODES` and the kap-server error handler forwards them. Startup and session-resume failures log the details too, so a support report still carries the versions. Local-form notes: the CLI entry point is `apps/kimi-code/src/main.ts`, not upstream's `cli/main.ts`, and it is that file's `logStartupFailure` that logs the details. `routes/fs.ts` has no `WIRE_VERSION_TOO_LOW` branch here — the fork routes it through the shared `mapError`, which is the path `PUBLIC_DETAIL_CODES` covers. A separate copy of the old wording remains in `packages/kap-server/src/search/indexCore.ts`; it reports the search index's own protocol version, has no upstream counterpart, and is out of scope. Verified: agent-core-v2 and apps/kimi-code typecheck clean, check-no-comments clean; new `readerVersion.test.ts` 2 pass, `test/wire` 111 pass with the same 2 pre-existing failures as `HEAD` (confirmed by stashing the wire changes and re-running: `heals a torn final line left by a disk-full crash` fails there too), kap-server transport-errors 18 pass.
7723qqq
pushed a commit
to 7723qqq/kimi-code
that referenced
this pull request
Nov 4, 2026
This was referenced Nov 10, 2026
Closed
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirement or Bug
跟随 #4638。读取声明了更高最低读取版本的会话时,CLI、TUI、SDK 和 kap-server 用户会在公开错误中看到
wire.jsonl与协议版本号等实现细节。本 PR 将主提示统一为直接升级 Kimi Code,同时把双方版本保留在结构化错误详情和诊断日志中。Bug Reproduction Steps
min_protocol_version: '9.9'的会话,使用支持协议1.5的客户端恢复或冷 fork。wire.version_too_low/40930 WIRE_VERSION_TOO_LOW错误。details.minReaderVersion和details.readerVersion获取。Root Cause
公开错误消息直接插值了诊断用版本号,且 kap-server 的公开详情白名单和局部错误映射没有完整传递该错误的
details。这是根本修复:公开文案与诊断数据分离,而不是在各个展示端分别隐藏版本号。Code Changes
wire.jsonl与协议版本放进主提示。fs路由统一传递minReaderVersion/readerVersion,保持错误码与既有恢复语义不变。WIRE_VERSION_TOO_LOW时附加结构化详情,便于诊断且不影响其他错误日志。Screenshots / Recordings
以下文本来自变更前后的公开错误定义与契约测试。
This wire.jsonl requires reader protocol 9.9; current Kimi Code supports 1.5. Upgrade Kimi Code to read this session.This session requires a newer version of Kimi Code. Upgrade Kimi Code to the latest version to read this session.Behavior Changes and Affected Users
wire.jsonl和双方协议版本details和诊断日志获取;精确匹配旧文案没有兼容退路40930响应统一携带minReaderVersion/readerVersionpackages/agent-core-v2/test/index.test.ts固定公开消息和结构化版本详情。sessions.test.ts覆盖冷 fork 的40930、新消息和详情;transport-errors.test.ts覆盖通用映射、全局异常处理器以及既有 session-conflict 详情保持不变。验证
corepack pnpm vitest run packages/agent-core-v2/test/index.test.ts packages/kap-server/test/sessions.test.ts packages/kap-server/test/transport-errors.test.ts:3 个测试文件,126/126 通过。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.